# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
-EXCLUDE = webcit.h and vcard.h and userlist.c
-#!!!!!!!! for now
+EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
-PREDEFINED = WEBCIT_WITH_CALENDAR_SERVICE HAVE_OPENSSL ENABLE_NLS HAVE_ICONV
+PREDEFINED = WEBCIT_WITH_CALENDAR_SERVICE HAVE_OPENSSL ENABLE_NLS HAVE_ICONV HAVE_ZLIB
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
-UML_LOOK = NO
+UML_LOOK = YES
# If set to YES, the inheritance and collaboration graphs will show the
# relations between templates and their instances.
/*
* $Id$
- *
- * Functions which handle network and sharing configuration.
+ */
+/**
+ * \defgroup NetShareConf Functions which handle network and sharing configuration.
*
*/
-
+/*@{*/
#include "webcit.h"
+/**
+ * \brief edit a network node
+ */
void edit_node(void) {
char buf[SIZ];
char node[SIZ];
}
-
+/**
+ * \brief add a node
+ */
void display_add_node(void)
{
output_headers(1, 1, 2, 0, 0, 0);
wDumpContent(1);
}
+/**
+ * \brief modify an existing node
+ */
void display_edit_node(void)
{
char buf[512];
}
}
- else { /* command error getting configuration */
+ else { /** command error getting configuration */
wprintf("%s<br />\n", &buf[4]);
}
}
-
+/**
+ * \brief display all configured nodes
+ */
void display_netconf(void)
{
char buf[SIZ];
wDumpContent(1);
}
-
+/**
+ * \brief display the dialog to verify the deletion
+ */
void display_confirm_delete_node(void)
{
char node[SIZ];
wDumpContent(1);
}
-
+/**
+ * \brief actually delete the node
+ */
void delete_node(void)
{
char buf[SIZ];
display_netconf();
}
-
+/**
+ * \brief add a new node
+ */
void add_node(void)
{
char node[SIZ];
}
+/*@}*/
/*
* $Id$
- *
- * Functions which handle "sticky notes"
+ */
+/**
+ * \defgroup StickyNotes Functions which handle "sticky notes"
*
*/
-
+/*@{*/
#include "webcit.h"
#include "webserver.h"
+/**
+ * \brief display sticky notes
+ * \param msgnum the citadel mesage number
+ */
void display_note(long msgnum) {
char buf[SIZ];
char notetext[SIZ];
strcpy(notetext, "");
while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
- /* Fill the buffer to at least 256 characters */
+ /** Fill the buffer to at least 256 characters */
if ( (in_text) && (strlen(notetext) < 256) ) {
strcat(notetext, buf);
}
}
}
- /* Now sanitize the buffer, and shorten it to just a small snippet */
+ /** Now sanitize the buffer, and shorten it to just a small snippet */
for (i=0; i<strlen(notetext); ++i) {
if (isspace(notetext[i])) notetext[i] = ' ';
}
strcpy(¬etext[72], "...");
- /* Make it HTML-happy and print it. */
+ /** Make it HTML-happy and print it. */
stresc(display_notetext, notetext, 1, 1);
wprintf("%s<br />\n", display_notetext);
}
+
+
+/*@}*/
/*
* $Id$
- *
- * Functions which implement the chat and paging facilities.
*/
-
+/**
+ * \defgroup PageFunc Functions which implement the chat and paging facilities.
+ */
+/*@{*/
#include "webcit.h"
-/*
- * display the form for paging (x-messaging) another user
+/**
+ * \brief display the form for paging (x-messaging) another user
*/
void display_page(void)
{
wDumpContent(1);
}
-/*
- * page another user
+/**
+ * \brief page another user
*/
void page_user(void)
{
-/*
- * multiuser chat
+/**
+ * \brief multiuser chat
*/
void do_chat(void)
{
char buf[SIZ];
- /* First, check to make sure we're still allowed in this room. */
+ /** First, check to make sure we're still allowed in this room. */
serv_printf("GOTO %s", WC->wc_roomname);
serv_getln(buf, sizeof buf);
if (buf[0] != '2') {
return;
}
- /* If the chat socket is still open from a previous chat,
+ /**
+ * If the chat socket is still open from a previous chat,
* close it -- because it might be stale or in the wrong room.
*/
if (WC->chat_sock < 0) {
WC->chat_sock = (-1);
}
- /* WebCit Chat works by having transmit, receive, and refresh
+ /**
+ * WebCit Chat works by having transmit, receive, and refresh
* frames. Load the frameset. (This isn't AJAX but the headers
* output by begin_ajax_response() happen to be the ones we need.)
*/
}
-/*
+/**
+ * \brief display page popup
* If there are instant messages waiting, and we notice that we haven't checked them in
* a while, it probably means that we need to open the instant messenger window.
*/
{
char buf[SIZ];
- /* First, do the check as part of our page load. */
+ /** First, do the check as part of our page load. */
serv_puts("NOOP");
serv_getln(buf, sizeof buf);
if (buf[3] == '*') {
}
}
- /* Then schedule it to happen again a minute from now if the user is idle. */
+ /** Then schedule it to happen again a minute from now if the user is idle. */
wprintf("<script type=\"text/javascript\"> \n"
" function HandleSslp(sslg_xmlresponse) { \n"
" sslg_response = sslg_xmlresponse.responseText.substr(0, 1); \n"
-/*
- * Support function for chat -- make sure the chat socket is connected
+/**
+ * \brief Support function for chat
+ * make sure the chat socket is connected
* and in chat mode.
*/
int setup_chat_socket(void) {
if (WC->chat_sock < 0) {
if (!strcasecmp(ctdlhost, "uds")) {
- /* unix domain socket */
+ /** unix domain socket */
sprintf(buf, "%s/citadel.socket", ctdlport);
WC->chat_sock = uds_connectsock(buf);
}
else {
- /* tcp socket */
+ /** tcp socket */
WC->chat_sock = tcp_connectsock(ctdlhost, ctdlport);
}
return(errno);
}
- /* Temporarily swap the serv and chat sockets during chat talk */
+ /** Temporarily swap the serv and chat sockets during chat talk */
i = WC->serv_sock;
WC->serv_sock = WC->chat_sock;
WC->chat_sock = i;
}
}
- /* Unswap the sockets. */
+ /** Unswap the sockets. */
i = WC->serv_sock;
WC->serv_sock = WC->chat_sock;
WC->chat_sock = i;
-/*
- * Receiving side of the chat window. This is implemented in a
+/**
+ * \brief Receiving side of the chat window.
+ * This is implemented in a
* tiny hidden IFRAME that just does JavaScript writes to
* other frames whenever it refreshes and finds new data.
*/
return;
}
- /*
+ /**
* See if there is any chat data waiting.
*/
output_data = strdup("");
if (poll(&pf, 1, 1) > 0) if (pf.revents & POLLIN) {
++got_data;
- /* Temporarily swap the serv and chat sockets during chat talk */
+ /** Temporarily swap the serv and chat sockets during chat talk */
i = WC->serv_sock;
WC->serv_sock = WC->chat_sock;
WC->chat_sock = i;
end_chat_now = 1;
}
- /* Unswap the sockets. */
+ /** Unswap the sockets. */
i = WC->serv_sock;
WC->serv_sock = WC->chat_sock;
WC->chat_sock = i;
- /* Append our output data */
+ /** Append our output data */
output_data = realloc(output_data, strlen(output_data) + strlen(buf) + 4);
strcat(output_data, buf);
strcat(output_data, "\n");
output_data[strlen(output_data)-1] = 0;
}
- /* Output our fun to the other frame. */
+ /** Output our fun to the other frame. */
wprintf("<img src=\"static/blank.gif\" WIDTH=1 HEIGHT=1\n"
"onLoad=\" \n"
);
}
-/*
- * sending side of the chat window
+/**
+ * \brief sending side of the chat window
*/
void chat_send(void) {
int i;
return;
}
- /* Temporarily swap the serv and chat sockets during chat talk */
+ /** Temporarily swap the serv and chat sockets during chat talk */
i = WC->serv_sock;
WC->serv_sock = WC->chat_sock;
WC->chat_sock = i;
}
}
- /* Unswap the sockets. */
+ /** Unswap the sockets. */
i = WC->serv_sock;
WC->serv_sock = WC->chat_sock;
WC->chat_sock = i;
wDumpContent(0);
}
+/*@}*/
/*
* $Id$
- *
- * Manage user preferences with a little help from the Citadel server.
+ */
+/**
+ * \defgroup ManagePrefs Manage user preferences with a little help from the Citadel server.
*
*/
-
+/*@{*/
#include "webcit.h"
#include "webserver.h"
#include "groupdav.h"
-
+/**
+ * \brief display preferences dialog
+ */
void load_preferences(void) {
char buf[SIZ];
long msgnum = 0L;
}
}
- /* Go back to the room we're supposed to be in */
+ /** Go back to the room we're supposed to be in */
serv_printf("GOTO %s", WC->wc_roomname);
serv_getln(buf, sizeof buf);
}
-/*
- * Goto the user's configuration room, creating it if necessary.
- * Returns 0 on success or nonzero upon failure.
+/**
+ * \brief Goto the user's configuration room, creating it if necessary.
+ * \return 0 on success or nonzero upon failure.
*/
int goto_config_room(void) {
char buf[SIZ];
return(0);
}
-
+/**
+ * \brief save the modifications
+ */
void save_preferences(void) {
char buf[SIZ];
long msgnum = 0L;
serv_puts("000");
}
- /* Go back to the room we're supposed to be in */
+ /** Go back to the room we're supposed to be in */
serv_printf("GOTO %s", WC->wc_roomname);
serv_getln(buf, sizeof buf);
}
+/**
+ * \brief query the actual setting of key in the citadel database
+ * \param key config key to query
+ * \param value value to the key to get
+ * \param value_len length of the value string
+ */
void get_preference(char *key, char *value, size_t value_len) {
int num_prefs;
int i;
}
}
+/**
+ * \brief Write a key into the citadel settings database
+ * \param key key whichs value is to be modified
+ * \param value value to set
+ * \param save_to_server really write it????
+ */
void set_preference(char *key, char *value, int save_to_server) {
int num_prefs;
int i;
-/*
- * display form for changing your preferences and settings
+/**
+ * \brief display form for changing your preferences and settings
*/
void display_preferences(void)
{
wprintf("<div class=\"fix_scrollbar_bug\">"
"<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>\n");
- /* begin form */
+ /** begin form */
wprintf("<center>\n"
"<form name=\"prefform\" action=\"set_preferences\" "
"method=\"post\">\n"
"<table border=0 cellspacing=5 cellpadding=5>\n");
- /*
+ /**
* Room list view
*/
get_preference("roomlistview", buf, sizeof buf);
wprintf("</td></tr>\n");
- /*
+ /**
* Calendar hour format
*/
get_preference("calhourformat", calhourformat, sizeof calhourformat);
wprintf("</td></tr>\n");
- /*
+ /**
* Calendar day view -- day start time
*/
get_preference("daystart", buf, sizeof buf);
wprintf("</SELECT>\n");
wprintf("</td></tr>\n");
- /*
+ /**
* Calendar day view -- day end time
*/
get_preference("dayend", buf, sizeof buf);
wprintf("</SELECT>\n");
wprintf("</td></tr>\n");
- /*
+ /**
* Signature
*/
get_preference("use_sig", buf, sizeof buf);
wprintf("</form></center>\n");
- /* end form */
+ /** end form */
wprintf("</td></tr></table></div>\n");
wDumpContent(1);
}
-/*
- * Commit new preferences and settings
+/**
+ * \brief Commit new preferences and settings
*/
void set_preferences(void)
{
return;
}
- /* Set the last argument to 1 only for the final setting, so
+ /**
+ * Set the last argument to 1 only for the final setting, so
* we don't send the prefs file to the server repeatedly
*/
set_preference("roomlistview", bstr("roomlistview"), 0);
display_main_menu();
}
+
+
+/*@}*/
/*
* $Id$
- *
- * Lots of different room-related operations.
*/
-
+/**
+ * \defgroup RoomOps Lots of different room-related operations.
+ */
+/*@{*/
#include "webcit.h"
-char floorlist[128][SIZ];
+char floorlist[128][SIZ]; /**< list of our floor names */
-char *viewdefs[7];
+char *viewdefs[7]; /**< the different kinds of available views */
+/**
+ * \brief initialize the viewdefs with localized strings
+ */
void initialize_viewdefs(void) {
viewdefs[0] = _("Bulletin Board");
viewdefs[1] = _("Mail Folder");
}
-/*
- * load the list of floors
+/**
+ * \brief load the list of floors
*/
void load_floorlist(void)
{
}
-/*
- * remove a room from the march list
+/**
+ * \brief remove a room from the march list
*/
void remove_march(char *aaa)
{
-
+/**
+ * \brief display rooms in tree structure???
+ * \param rp the roomlist to build a tree from
+ */
void room_tree_list(struct roomlisting *rp)
{
char rmname[64];
}
-/*
- * Room ordering stuff (compare first by floor, then by order)
+/**
+ * \brief Room ordering stuff (compare first by floor, then by order)
+ * \param r1 first roomlist to compare
+ * \param r2 second roomlist co compare
+ * \return are they the same???
*/
int rordercmp(struct roomlisting *r1, struct roomlisting *r2)
{
}
-/*
- * Common code for all room listings
+/**
+ * \brief Common code for all room listings
+ * \param variety what???
*/
void listrms(char *variety)
{
struct roomlisting *rs;
- /* Ask the server for a room list */
+ /** Ask the server for a room list */
serv_puts(variety);
serv_getln(buf, sizeof buf);
if (buf[0] != '1') {
room_tree_list(rl);
- /* If no rooms were listed, print an nbsp to make the cell
+ /**
+ * If no rooms were listed, print an nbsp to make the cell
* borders show up anyway.
*/
if (num_rooms == 0) wprintf(" ");
}
-/*
- * list all forgotten rooms
+/**
+ * \brief list all forgotten rooms
*/
void zapped_list(void)
{
}
-/*
- * read this room's info file (set v to 1 for verbose mode)
+/**
+ * \brief read this room's info file (set v to 1 for verbose mode)
*/
void readinfo(void)
{
-/* Display room banner icon. The server doesn't actually
+/**
+ * \brief Display room banner icon.
+ * The server doesn't actually
* need the room name, but we supply it in order to
* keep the browser from using a cached icon from
* another room.
-/*
- * Display the current view and offer an option to change it
+/**
+ * \brief Display the current view and offer an option to change it
*/
void embed_view_o_matic(void) {
int i;
"[selectedIndex].value\">\n");
for (i=0; i<(sizeof viewdefs / sizeof (char *)); ++i) {
- /*
+ /**
* Only offer the views that make sense, given the default
* view for the room. For example, don't offer a Calendar
* view in a non-Calendar room.
}
-
+/**
+ * \brief view room banner
+ * \param got what???
+ * \param navbar_style
+ */
void embed_room_banner(char *got, int navbar_style) {
char fakegot[SIZ];
- /* We need to have the information returned by a GOTO server command.
+ /**
+ * We need to have the information returned by a GOTO server command.
* If it isn't supplied, we fake it by issuing our own GOTO.
*/
if (got == NULL) {
got = fakegot;
}
- /* The browser needs some information for its own use */
+ /** The browser needs some information for its own use */
wprintf("<script type=\"text/javascript\"> \n"
" room_is_trash = %d; \n"
"</script>\n",
WC->wc_is_trash
);
- /* If the user happens to select the "make this my start page" link,
+ /**
+ * If the user happens to select the "make this my start page" link,
* we want it to remember the URL as a "/dotskip" one instead of
* a "skip" or "gotonext" or something like that.
*/
snprintf(WC->this_page, sizeof(WC->this_page), "dotskip&room=%s",
WC->wc_roomname);
- /* Check for new mail. */
+ /** Check for new mail. */
WC->new_mail = extract_int(&got[4], 9);
WC->wc_view = extract_int(&got[4], 11);
-/*
- * back end routine to take the session to a new room
+/**
+ * \brief back end routine to take the session to a new room
+ * \param gname room to go to
*
*/
int gotoroom(char *gname)
static long ls = (-1L);
int err = 0;
- /* store ungoto information */
+ /** store ungoto information */
strcpy(WC->ugname, WC->wc_roomname);
WC->uglsn = ls;
- /* move to the new room */
+ /** move to the new room */
serv_printf("GOTO %s", gname);
serv_getln(buf, sizeof buf);
if (buf[0] != '2') {
}
-/*
- * Locate the room on the march list which we most want to go to. Each room
+/**
+ * \brief Locate the room on the march list which we most want to go to.
+ * Each room
* is measured given a "weight" of preference based on various factors.
+ * \param desired_floor the room number on the citadel server
+ * \return the roomname
*/
char *pop_march(int desired_floor)
{
-/* Goto next room having unread messages.
+/**
+ *\brief Goto next room having unread messages.
* We want to skip over rooms that the user has already been to, and take the
* user back to the lobby when done. The room we end up in is placed in
* newroom - which is set to 0 (the lobby) initially.
struct march *mptr, *mptr2;
char next_room[128];
- /* First check to see if the march-mode list is already allocated.
+ /**
+ * First check to see if the march-mode list is already allocated.
* If it is, pop the first room off the list and go there.
*/
mptr2->next = mptr;
}
}
-/* add _BASEROOM_ to the end of the march list, so the user will end up
- * in the system base room (usually the Lobby>) at the end of the loop
- */
+ /**
+ * add _BASEROOM_ to the end of the march list, so the user will end up
+ * in the system base room (usually the Lobby>) at the end of the loop
+ */
mptr = (struct march *) malloc(sizeof(struct march));
mptr->next = NULL;
strcpy(mptr->march_name, "_BASEROOM_");
mptr2 = mptr2->next;
mptr2->next = mptr;
}
-/*
- * ...and remove the room we're currently in, so a <G>oto doesn't make us
- * walk around in circles
- */
+ /**
+ * ...and remove the room we're currently in, so a <G>oto doesn't make us
+ * walk around in circles
+ */
remove_march(WC->wc_roomname);
}
if (WC->march != NULL) {
}
+/**
+ * \brief goto next room
+ * \param next_room next room to go to
+ */
void smart_goto(char *next_room) {
gotoroom(next_room);
readloop("readnew");
-/*
- * mark all messages in current room as having been read
+/**
+ * \brief mark all messages in current room as having been read
*/
void slrp_highest(void)
{
}
-/*
- * un-goto the previous room
+/**
+ * \brief un-goto the previous room
*/
void ungoto(void)
{
-/*
- * Set/clear/read the "self-service list subscribe" flag for a room
+/**
+ * \brief Set/clear/read the "self-service list subscribe" flag for a room
*
- * Set 'newval' to 0 to clear, 1 to set, any other value to leave unchanged.
- * Always returns the new value.
+ * \param newval set to 0 to clear, 1 to set, any other value to leave unchanged.
+ * \return return the new value.
*/
int self_service(int newval) {
-/*
- * display the form for editing a room
+/**
+ * \brief display the form for editing a room
*/
void display_editroom(void)
{
output_headers(1, 1, 1, 0, 0, 0);
- /* print the tabbed dialog */
+ /** print the tabbed dialog */
wprintf("<br />"
"<div class=\"fix_scrollbar_bug\">"
"<TABLE border=0 cellspacing=0 cellpadding=0 width=100%%>"
wprintf("<TD> </TD>\n");
wprintf("</TR></TABLE></div>\n");
- /* end tabbed dialog */
+ /** end tabbed dialog */
- /* begin content of whatever tab is open now */
+ /** begin content of whatever tab is open now */
wprintf("<div class=\"fix_scrollbar_bug\">"
"<TABLE border=0 width=100%% bgcolor=\"#FFFFFF\">\n"
"<TR><TD>\n");
wprintf("> ");
wprintf(_("Read-only room"));
- /* directory stuff */
+ /** directory stuff */
wprintf("\n<LI><INPUT TYPE=\"checkbox\" NAME=\"directory\" VALUE=\"yes\" ");
if (er_flags & QR_DIRECTORY)
wprintf("CHECKED ");
wprintf(_("Visible directory"));
wprintf("</UL>\n");
- /* end of directory stuff */
+ /** end of directory stuff */
wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"network\" VALUE=\"yes\" ");
if (er_flags & QR_NETWORK)
wprintf("> ");
wprintf(_("Permanent (does not auto-purge)"));
- /* start of anon options */
+ /** start of anon options */
wprintf("\n<LI>");
wprintf(_("Anonymous messages"));
}
- /* Sharing the room with other Citadel nodes... */
+ /** Sharing the room with other Citadel nodes... */
if (!strcmp(tab, "sharing")) {
shared_with = strdup("");
not_shared_with = strdup("");
- /* Learn the current configuration */
+ /** Learn the current configuration */
serv_puts("CONF getsys|application/x-citadel-ignet-config");
serv_getln(buf, sizeof buf);
if (buf[0]=='1') while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
}
}
- /* Display the stuff */
+ /** Display the stuff */
wprintf("<CENTER><br />"
"<TABLE border=1 cellpadding=5><TR>"
"<TD><B><I>");
}
- /* Mailing list management */
+ /** Mailing list management */
if (!strcmp(tab, "listserv")) {
wprintf("<br /><center>"
}
- /* Mailing list management */
+ /** Mailing list management */
if (!strcmp(tab, "expire")) {
serv_puts("GPEX room");
}
- /* Mailing list management */
+ /** Mailing list management */
if (!strcmp(tab, "access")) {
display_whok();
}
- /* end content of whatever tab is open now */
+ /** end content of whatever tab is open now */
wprintf("</TD></TR></TABLE></div>\n");
wDumpContent(1);
}
-/*
- * Toggle self-service list subscription
+/**
+ * \brief Toggle self-service list subscription
*/
void toggle_self_service(void) {
int newval = 0;
-/*
- * save new parameters for a room
+/**
+ * \brief save new parameters for a room
*/
void editroom(void)
{
}
-/*
- * Display form for Invite, Kick, and show Who Knows a room
+/**
+ * \brief Display form for Invite, Kick, and show Who Knows a room
*/
void do_invt_kick(void) {
char buf[SIZ], room[SIZ], username[SIZ];
-/*
- * Display form for Invite, Kick, and show Who Knows a room
+/**
+ * \brief Display form for Invite, Kick, and show Who Knows a room
*/
void display_whok(void)
{
-/*
- * display the form for entering a new room
+/**
+ * \brief display the form for entering a new room
*/
void display_entroom(void)
{
}
wprintf("</SELECT>\n");
- /* Our clever little snippet of JavaScript automatically selects
- * a public room if the view is set to Bulletin Board or wiki, and
- * it selects a mailbox room otherwise. The user can override this,
- * of course. We also disable the floor selector for mailboxes.
- */
- wprintf("<LI>");
- wprintf(_("Default view for room: "));
+ /**
+ * Our clever little snippet of JavaScript automatically selects
+ * a public room if the view is set to Bulletin Board or wiki, and
+ * it selects a mailbox room otherwise. The user can override this,
+ * of course. We also disable the floor selector for mailboxes.
+ */
+ wprintf("<LI>");
+ wprintf(_("Default view for room: "));
wprintf("<SELECT NAME=\"er_view\" SIZE=\"1\" OnChange=\""
" if ( (this.form.er_view.value == 0) "
" || (this.form.er_view.value == 6) ) { "
-/*
- * support function for entroom() -- sets the default view
+/**
+ * \brief support function for entroom() -- sets the default view
*/
void er_set_default_view(int newview) {
-/*
- * enter a new room
+/**
+ * \brief enter a new room
*/
void entroom(void)
{
}
-/*
- * display the screen to enter a private room
+/**
+ * \brief display the screen to enter a private room
*/
void display_private(char *rname, int req_pass)
{
wDumpContent(1);
}
-/*
- * goto a private room
+/**
+ * \brief goto a private room
*/
void goto_private(void)
{
}
-/*
- * display the screen to zap a room
+/**
+ * \brief display the screen to zap a room
*/
void display_zap(void)
{
}
-/*
- * zap a room
+/**
+ * \brief zap a room
*/
void zap(void)
{
char buf[SIZ];
char final_destination[SIZ];
- /* If the forget-room routine fails for any reason, we fall back
+ /**
+ * If the forget-room routine fails for any reason, we fall back
* to the current room; otherwise, we go to the Lobby
*/
strcpy(final_destination, WC->wc_roomname);
-/*
- * Delete the current room
+/**
+ * \brief Delete the current room
*/
void delete_room(void)
{
-/*
- * Perform changes to a room's network configuration
+/**
+ * \brief Perform changes to a room's network configuration
*/
void netedit(void) {
FILE *fp;
return;
}
- /* This loop works for add *or* remove. Spiffy, eh? */
+ /** This loop works for add *or* remove. Spiffy, eh? */
while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
extract_token(cmpa0, buf, 0, '|', sizeof cmpa0);
extract_token(cmpa1, buf, 1, '|', sizeof cmpa1);
-/*
- * Convert a room name to a folder-ish-looking name.
+/**
+ * \brief Convert a room name to a folder-ish-looking name.
+ * \param folder the folderish name
+ * \param room the room name
+ * \param floor the floor name
+ * \param is_mailbox is it a mailbox?
*/
void room_to_folder(char *folder, char *room, int floor, int is_mailbox)
{
int i;
- /*
+ /**
* For mailboxes, just do it straight...
*/
if (is_mailbox) {
sprintf(folder, "My folders|%s", room);
}
- /*
+ /**
* Otherwise, prefix the floor name as a "public folders" moniker
*/
else {
sprintf(folder, "%s|%s", floorlist[floor], room);
}
- /*
+ /**
* Replace "\" characters with "|" for pseudo-folder-delimiting
*/
for (i=0; i<strlen(folder); ++i) {
-/*
- * Back end for change_view()
+/**
+ * \brief Back end for change_view()
+ * \param newview set newview???
*/
void do_change_view(int newview) {
char buf[SIZ];
-/*
- * Change the view for this room
+/**
+ * \brief Change the view for this room
*/
void change_view(void) {
int view;
}
-/*
- * One big expanded tree list view --- like a folder list
+/**
+ * \brief One big expanded tree list view --- like a folder list
+ * \param fold the folder to view
+ * \param max_folders how many folders???
+ * \param num_floors hom many floors???
*/
void do_folder_view(struct folder *fold, int max_folders, int num_floors) {
char buf[SIZ];
parents = malloc(max_folders * sizeof(int));
- /* BEGIN TREE MENU */
+ /** BEGIN TREE MENU */
wprintf("<div id=\"roomlist_div\">Loading folder list...</div>\n");
- /* include NanoTree */
+ /** include NanoTree */
wprintf("<script type=\"text/javascript\" src=\"static/nanotree.js\"></script>\n");
- /* initialize NanoTree */
+ /** initialize NanoTree */
wprintf("<script type=\"text/javascript\"> \n"
" showRootNode = false; \n"
" sortNodes = false; \n"
);
free(parents);
- /* END TREE MENU */
+ /** END TREE MENU */
}
-/*
- * Boxes and rooms and lists ... oh my!
+/**
+ * \brief Boxes and rooms and lists ... oh my!
+ * \param fold the folder to view
+ * \param max_folders how many folders???
+ * \param num_floors hom many floors???
*/
void do_rooms_view(struct folder *fold, int max_folders, int num_floors) {
char buf[256];
boxes_per_column = (nf / columns);
if (boxes_per_column < 1) boxes_per_column = 1;
- /* Outer table (for columnization) */
+ /** Outer table (for columnization) */
wprintf("<TABLE BORDER=0 WIDTH=96%% CELLPADDING=5>"
"<tr><td valign=top>");
strcpy(old_floor_name, floor_name);
if (levels == 1) {
- /* Begin inner box */
+ /** Begin inner box */
stresc(boxtitle, floor_name, 1, 0);
svprintf("BOXTITLE", WCS_STRING, boxtitle);
do_template("beginbox");
wprintf("<br />\n");
}
}
- /* End the final inner box */
+ /** End the final inner box */
do_template("endbox");
wprintf("</TD></TR></TABLE>\n");
}
-
+/**
+ * \brief print a floor div???
+ * \param which_floordiv name of the floordiv???
+ */
void set_floordiv_expanded(char *which_floordiv) {
begin_ajax_response();
safestrncpy(WC->floordiv_expanded, which_floordiv, sizeof WC->floordiv_expanded);
end_ajax_response();
}
-/*
- *
+/**
+ * \brief view the iconbar
+ * \param fold the folder to view
+ * \param max_folders how many folders???
+ * \param num_floors hom many floors???
*/
void do_iconbar_view(struct folder *fold, int max_folders, int num_floors) {
char buf[256];
if ( (strcasecmp(floor_name, old_floor_name))
&& (strlen(old_floor_name) > 0) ) {
- /* End inner box */
+ /** End inner box */
wprintf("<br>\n");
- wprintf("</div>\n"); /* floordiv */
+ wprintf("</div>\n"); /** floordiv */
}
strcpy(old_floor_name, floor_name);
if (levels == 1) {
- /* Begin floor */
+ /** Begin floor */
stresc(floordivtitle, floor_name, 0, 0);
sprintf(floordiv_id, "floordiv%d", i);
wprintf("<span class=\"ib_roomlist_floor\" "
wprintf(" ");
if (levels>2) for (t=0; t<(levels-2); ++t) wprintf(" ");
- /* choose the icon */
+ /** choose the icon */
if (fold[i].view == VIEW_ADDRESSBOOK) {
icon = "viewcontacts_16x.gif" ;
}
wprintf("</i>");
}
wprintf("<br />");
- wprintf("</div>\n"); /* roomdiv */
+ wprintf("</div>\n"); /** roomdiv */
}
}
- wprintf("</div>\n"); /* floordiv */
+ wprintf("</div>\n"); /** floordiv */
- /* BEGIN: The old invisible pixel trick, to get our JavaScript to initialize */
+ /** BEGIN: The old invisible pixel trick, to get our JavaScript to initialize */
wprintf("<img src=\"static/blank.gif\" onLoad=\"\n");
num_drop_targets = 0;
}
wprintf("\">\n");
- /* END: The old invisible pixel trick, to get our JavaScript to initialize */
+ /** END: The old invisible pixel trick, to get our JavaScript to initialize */
}
-/*
- * Show the room list. (only should get called by
+/**
+ * \brief Show the room list.
+ * (only should get called by
* knrooms() because that's where output_headers() is called from)
+ * \param viewpref the view preferences???
*/
void list_all_rooms_by_floor(char *viewpref) {
int i, j;
int ra_flags = 0;
int flags = 0;
- int num_floors = 1; /* add an extra one for private folders */
+ int num_floors = 1; /** add an extra one for private folders */
- /* If our cached folder list is very old, burn it. */
+ /** If our cached folder list is very old, burn it. */
if (WC->cache_fold != NULL) {
if ((time(NULL) - WC->cache_timestamp) > 300) {
free(WC->cache_fold);
}
}
- /* Can we do the iconbar roomlist from cache? */
+ /** Can we do the iconbar roomlist from cache? */
if ((WC->cache_fold != NULL) && (!strcasecmp(viewpref, "iconbar"))) {
do_iconbar_view(WC->cache_fold, WC->cache_max_folders, WC->cache_num_floors);
return;
}
- /* Grab the floor table so we know how to build the list... */
+ /** Grab the floor table so we know how to build the list... */
load_floorlist();
- /* Start with the mailboxes */
+ /** Start with the mailboxes */
max_folders = 1;
alloc_folders = 1;
fold = malloc(sizeof(struct folder));
strcpy(fold[0].name, "My folders");
fold[0].is_mailbox = 1;
- /* Then add floors */
+ /** Then add floors */
serv_puts("LFLR");
serv_getln(buf, sizeof buf);
if (buf[0]=='1') while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
++num_floors;
}
- /* Now add rooms */
+ /** Now add rooms */
serv_puts("LKRA");
serv_getln(buf, sizeof buf);
if (buf[0]=='1') while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
++max_folders;
}
- /* Bubble-sort the folder list */
+ /** Bubble-sort the folder list */
for (i=0; i<max_folders; ++i) {
for (j=0; j<(max_folders-1)-i; ++j) {
if (fold[j].is_mailbox == fold[j+1].is_mailbox) {
}
-/* Do either a known rooms list or a folders list, depending on the
+/**
+ * \brief Do either a known rooms list or a folders list, depending on the
* user's preference
*/
-void knrooms() {
+void knrooms(void)
+{
char listviewpref[SIZ];
output_headers(1, 1, 2, 0, 0, 0);
- /* Determine whether the user is trying to change views */
+ /** Determine whether the user is trying to change views */
if (bstr("view") != NULL) {
if (strlen(bstr("view")) > 0) {
set_preference("roomlistview", bstr("view"), 1);
strcpy(listviewpref, "rooms");
}
- /* title bar */
+ /** title bar */
wprintf("<div id=\"banner\">\n"
"<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
"<SPAN CLASS=\"titlebar\">"
}
wprintf("</SPAN></TD>\n");
- /* offer the ability to switch views */
+ /** offer the ability to switch views */
wprintf("<TD ALIGN=RIGHT><FORM NAME=\"roomlistomatic\">\n"
"<SELECT NAME=\"newview\" SIZE=\"1\" "
"OnChange=\"location.href=roomlistomatic.newview.options"
"</div>\n"
"<div id=\"content\">\n");
- /* Display the room list in the user's preferred format */
+ /** Display the room list in the user's preferred format */
list_all_rooms_by_floor(listviewpref);
wDumpContent(1);
}
-/*
- * Set the message expire policy for this room and/or floor
+/**
+ * \brief Set the message expire policy for this room and/or floor
*/
void set_room_policy(void) {
char buf[SIZ];
display_editroom();
}
+
+
+/*@}*/
/*
* $Id$
- *
- * Generate some RSS for our rooms.
*/
-
+/**
+ * \defgroup RssRooms Generate some RSS for our rooms.
+ */
+/*@{*/
#include "webcit.h"
#include "webserver.h"
-time_t if_modified_since;
-
+time_t if_modified_since; /**< the last modified stamp */
+/**
+ * \brief view rss Config menu
+ * \param reply_to the original author
+ * \param subject the subject of the feed
+ */
void display_rss_control(char *reply_to, char *subject)
{
wprintf("<div style=\"align: right;\"><p>\n");
}
+/**
+ * \brief print the feed to the subscriber
+ * \param roomname the room we sould print out as rss
+ * \param request_method the way the rss is requested????
+ */
void display_rss(char *roomname, char *request_method)
{
int nummsgs;
struct tm now_tm;
#ifdef HAVE_ICONV
iconv_t ic = (iconv_t)(-1) ;
- char *ibuf; /* Buffer of characters to be converted */
- char *obuf; /* Buffer for converted characters */
- size_t ibuflen; /* Length of input buffer */
- size_t obuflen; /* Length of output buffer */
- char *osav; /* Saved pointer to output buffer */
+ char *ibuf; /**< Buffer of characters to be converted */
+ char *obuf; /**< Buffer for converted characters */
+ size_t ibuflen; /**< Length of input buffer */
+ size_t obuflen; /**< Length of output buffer */
+ char *osav; /**< Saved pointer to output buffer */
#endif
char buf[SIZ];
char date[30];
return;
}
- /* Read time of last message immediately */
+ /** Read time of last message immediately */
serv_printf("MSG4 %ld", WC->msgarr[nummsgs - 1]);
serv_getln(buf, sizeof buf);
if (buf[0] == '1') {
escputs(roomname);
wprintf("</link>\n");
wprintf(" <description>");
- /* Get room info for description */
+ /** Get room info for description */
serv_puts("RINF");
serv_getln(buf, sizeof buf);
if (buf[0] == '1') {
wprintf(" <docs>http://blogs.law.harvard.edu/tech/rss</docs>\n");
wprintf(" <ttl>30</ttl>\n");
- /* Read all messages and output as RSS items */
+ /** Read all messages and output as RSS items */
for (a = 0; a < nummsgs; ++a) {
- /* Read message and output each as RSS item */
+ /** Read message and output each as RSS item */
serv_printf("MSG4 %ld", WC->msgarr[a]);
serv_getln(buf, sizeof buf);
if (buf[0] != '1') continue;
while (serv_getln(buf, sizeof buf), strcasecmp(buf, "text")) {
if (!strcmp(buf, "000")) {
- goto ENDITEM; /* screw it */
+ goto ENDITEM; /** screw it */
} else if (!strncasecmp(buf, "from=", 5)) {
strcpy(from, &buf[5]);
#ifdef HAVE_ICONV
wprintf(" <pubDate>%s</pubDate>\n", date);
}
wprintf(" <guid isPermaLink=\"false\">%s</guid>\n", msgn);
- /* Now the hard part, the message itself */
+ /** Now the hard part, the message itself */
strcpy(content_type, "text/plain");
while (serv_getln(buf, sizeof buf), strlen(buf) > 0) {
if (!strcmp(buf, "000")) {
}
}
- /* Set up a character set conversion if we need to */
+ /** Set up a character set conversion if we need to */
#ifdef HAVE_ICONV
if (strcasecmp(charset, "us-ascii") && strcasecmp(charset, "utf-8") && strcasecmp(charset, "") ) {
ic = iconv_open("UTF-8", charset);
}
#endif
- /* Messages in legacy Citadel variformat get handled thusly... */
+ /** Messages in legacy Citadel variformat get handled thusly... */
if (!strcasecmp(content_type, "text/x-citadel-variformat")) {
int intext = 0;
display_rss_control(from, subj);
wprintf("]]></description>\n");
}
- /* Boring old 80-column fixed format text gets handled this way... */
+ /** Boring old 80-column fixed format text gets handled this way... */
else if (!strcasecmp(content_type, "text/plain")) {
wprintf(" <description><![CDATA[");
while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
display_rss_control(from, subj);
wprintf("]]></description>\n");
}
- /* HTML is fun, but we've got to strip it first */
+ /** HTML is fun, but we've got to strip it first */
else if (!strcasecmp(content_type, "text/html")) {
wprintf(" <description><![CDATA[");
output_html(charset);
now = 0L;
}
- /* Do RSS footer */
+ /** Do RSS footer */
wprintf(" </channel>\n");
wprintf("</rss>\n");
wDumpContent(0);
}
+
+
+/*@}*/
/*
* $Id$
- *
- * Handles various types of data transfer operations with the Citadel service.
+ */
+/**
+ * \defgroup ServFuncs Handles various types of data transfer operations with the Citadel service.
*
*/
+/*@{*/
#include "webcit.h"
#include "webserver.h"
-struct serv_info serv_info;
+struct serv_info serv_info; /**< our connection data to the server */
-/*
- * get info about the server we've connected to
+/**
+ * \brief get info about the server we've connected to
+ * \param browser_host the citadell we want to connect to
+ * \param user_agent which browser uses our client?
*/
void get_serv_info(char *browser_host, char *user_agent)
{
char buf[SIZ];
int a;
- /* Tell the server what kind of client is connecting */
+ /** Tell the server what kind of client is connecting */
serv_printf("IDEN %d|%d|%d|%s|%s",
DEVELOPER_ID,
CLIENT_ID,
);
serv_getln(buf, sizeof buf);
- /* Tell the server what kind of richtext we prefer */
+ /** Tell the server what kind of richtext we prefer */
serv_puts("MSGP text/html|text/plain");
serv_getln(buf, sizeof buf);
#ifdef WEBCIT_WITH_CALENDAR_SERVICE
- /* Tell the server that when we save a calendar event, we
+ /**
+ * Tell the server that when we save a calendar event, we
* want invitations to be generated by the Citadel server
* instead of by the client.
*/
serv_getln(buf, sizeof buf);
#endif
- /* Now ask the server to tell us a little bit about itself... */
+ /** Now ask the server to tell us a little bit about itself... */
serv_puts("INFO");
serv_getln(buf, sizeof buf);
if (buf[0] != '1')
-/*
- * Read Citadel variformat text and spit it out as HTML.
+/**
+ * \brief Read Citadel variformat text and spit it out as HTML.
+ * \param align html align string
*/
void fmout(char *align)
{
}
intext = 1;
- /* Quoted text should be displayed in italics and in a
+ /**
+ * Quoted text should be displayed in italics and in a
* different colour. This code understands Citadel-style
* " >" quotes and will convert to <BLOCKQUOTE> tags.
*/
if ((bq == 1) && (!strncmp(buf, " >", 2))) {
strcpy(buf, &buf[2]);
}
- /* Activate embedded URL's */
+ /** Activate embedded URL's */
url(buf);
escputs(buf);
-/*
- * Read Citadel variformat text and spit it out as HTML in a form
+/**
+ * \brief Read Citadel variformat text and spit it out as HTML in a form
* suitable for embedding in another message (forward/quote).
* (NO LINEBREAKS ALLOWED HERE!)
*/
}
intext = 1;
- /* Quoted text should be displayed in italics and in a
+ /**
+ * Quoted text should be displayed in italics and in a
* different colour. This code understands Citadel-style
* " >" quotes and will convert to <BLOCKQUOTE> tags.
*/
-/*
- * Transmit message text (in memory) to the server.
- * If convert_to_html is set to 1, the message is converted into something
+/**
+ * \brief Transmit message text (in memory) to the server.
+ * \param ptr the output buffer
+ * \param convert_to_html if set to 1, the message is converted into something
* which kind of resembles HTML.
*/
void text_to_server(char *ptr, int convert_to_html)
-/*
- * translate server message output to text
+/**
+ * \brief translate server message output to text
* (used for editing room info files and such)
*/
void server_to_text()
-/*
+/**
* Read binary data from server into memory using a series of
* server READ commands.
+ * \param buffer the output buffer
+ * \param total_len the maximal length of buffer
*/
void read_server_binary(char *buffer, size_t total_len) {
char buf[SIZ];
}
-/*
- * Read text from server, appending to a string buffer until the
+/**
+ * \brief Read text from server, appending to a string buffer until the
* usual 000 terminator is found. Caller is responsible for freeing
* the returned pointer.
*/
return(text);
}
+
+
+
+/*@}*/
/*
* $Id$
- *
- * Administrative screen for site-wide configuration
+ */
+/**
+ * \defgroup AdminConfig Administrative screen for site-wide configuration
*
*/
-
+/*@{*/
#include "webcit.h"
-
+/**
+ * \brief display all configuration items
+ */
void display_siteconfig(void)
{
char buf[SIZ];
char purger[SIZ];
char idxjnl[SIZ];
- /* expire policy settings */
+ /** expire policy settings */
int sitepolicy = 0;
int sitevalue = 0;
int mboxpolicy = 0;
wDumpContent(1);
}
-
+/**
+ * parse siteconfig changes
+ */
void siteconfig(void)
{
char buf[256];
sizeof WC->ImportantMessage);
display_aide_menu();
}
+
+
+/*@}*/
/*
* $Id$
- *
- * modified from Sten Gunterberg's BUGTRAQ post of 22 Jul 1997
+ */
+/**
+ * \defgroup SnprintfReplacement modified from Sten Gunterberg's BUGTRAQ post of 22 Jul 1997
* --nathan bryant <bryant@cs.usm.maine.edu>
*
*/
-
-/*
- * Replacements for snprintf() and vsnprintf()
+/*@{*/
+/**
+ * \brief Replacements for snprintf() and vsnprintf()
*
* Use it only if you have the "spare" cycles needed to effectively
* do every snprintf operation twice! Why is that? Because everything
#include "webcit.h"
#include "webserver.h"
+/**
+ * \brief is it needed????
+ * \param fmt the formatstring?
+ * \param argp how many params?
+ */
static int needed(const char *fmt, va_list argp)
{
static FILE *sink = NULL;
- /* ok, there's a small race here that could result in the sink being
+ /**
+ * ok, there's a small race here that could result in the sink being
* opened more than once if we're threaded, but I'd rather ignore it than
* spend cycles synchronizing :-) */
return vfprintf(sink, fmt, argp);
}
+/**
+ * \brief vsnprintf wrapper
+ * \param buf the output charbuffer
+ * \param max maximal size of the buffer
+ * \param fmt the formatstring (see man printf)
+ * \param argp the variable argument list
+ */
int vsnprintf(char *buf, size_t max, const char *fmt, va_list argp)
{
char *p;
return size;
}
+/**
+ * \brief snprintf wrapper
+ * \param buf the output charbuffer
+ * \param max maximal size of the buffer
+ * \param fmt the formatstring (see man printf)
+ * \param ... the variable argument list
+ */
int snprintf(char *buf, size_t max, const char *fmt,...)
{
va_list argp;
return bytes;
}
+
+
+
+/*@}*/
/*
* $Id$
- *
- * Variable substitution type stuff
+ */
+/**
+ * \defgroup Subst Variable substitution type stuff
*
*/
-
+/*@{*/
#include "webcit.h"
-/*
- * Clear out the list of substitution variables local to this session
+/**
+ * \brief Clear out the list of substitution variables local to this session
*/
void clear_local_substs(void) {
struct wcsubst *ptr;
/*
- * Add a substitution variable (local to this session)
+ * \brief Add a substitution variable (local to this session)
+ * \param keyname the replacementstring to substitute
+ * \param keytype the kind of the key
+ * \param format the format string ala printf
+ * \param ... the arguments to substitute in the formatstring
*/
void svprintf(char *keyname, int keytype, const char *format,...)
{
struct wcsubst *ptr = NULL;
struct wcsubst *scan;
- /* First scan through to see if we're doing a replacement of
+ /**
+ * First scan through to see if we're doing a replacement of
* an existing key
*/
for (scan=WC->vars; scan!=NULL; scan=scan->next) {
}
}
- /* Otherwise allocate a new one */
+ /** Otherwise allocate a new one */
if (ptr == NULL) {
ptr = (struct wcsubst *) malloc(sizeof(struct wcsubst));
ptr->next = WC->vars;
WC->vars = ptr;
}
- /* Format the string and save it */
+ /** Format the string and save it */
va_start(arg_ptr, format);
vsnprintf(wbuf, sizeof wbuf, format, arg_ptr);
ptr->wcs_value = strdup(wbuf);
}
-/*
- * Add a substitution variable (local to this session) that does a callback
+/**
+ * \brief Add a substitution variable (local to this session) that does a callback
+ * \param keyname the keystring to substitute
+ * \param fcn_ptr the function callback to give the substitution string
*/
void svcallback(char *keyname, void (*fcn_ptr)() )
{
-/*
- * back end for print_value_of() ... does a server command
+/**
+ * \brief back end for print_value_of() ... does a server command
+ * \param servcmd server command to execute on the citadel server
*/
void pvo_do_cmd(char *servcmd) {
char buf[SIZ];
-/*
- * Print the value of a variable
+/**
+ * \brief Print the value of a variable
+ * \param keyname get a key to print
*/
void print_value_of(char *keyname) {
struct wcsubst *ptr;
escputs(WC->wc_roomname);
}
- /* Page-local variables */
+ /** Page-local variables */
else for (ptr = WC->vars; ptr != NULL; ptr = ptr->next) {
if (!strcasecmp(ptr->wcs_key, keyname)) {
if (ptr->wcs_type == WCS_STRING) {
-/*
- * Display a variable-substituted template
+/**
+ * \brief Display a variable-substituted template
+ * \param templatename template file to load
*/
void do_template(void *templatename) {
char filename[PATH_MAX];
fclose(fp);
}
+
+
+
+/*@}*/
/*
* $Id$
- *
- * Displays the "Summary Page"
*/
-
+/**
+ * \defgroup SymaryFuncs Displays the "Summary Page"
+ */
+/*@{*/
#include "webcit.h"
-/*
- * Display today's date in a friendly format
+/**
+ * \brief Display today's date in a friendly format
*/
void output_date(void) {
struct tm tm;
-/*
- * Dummy section
+/**
+ * \brief Dummy section
*/
void dummy_section(void) {
svprintf("BOXTITLE", WCS_STRING, "(dummy section)");
}
-/*
- * New messages section
+/**
+ * \brief New messages section
*/
void new_messages_section(void) {
char buf[SIZ];
}
-/*
- * Wholist section
+/**
+ * \brief Wholist section
*/
void wholist_section(void) {
char buf[SIZ];
}
-/*
- * Task list section
+/**
+ * \brief Task list section
*/
void tasks_section(void) {
#ifdef WEBCIT_WITH_CALENDAR_SERVICE
}
-/*
- * Calendar section
+/**
+ * \brief Calendar section
*/
void calendar_section(void) {
#ifdef WEBCIT_WITH_CALENDAR_SERVICE
do_template("endbox");
}
-/*
- * Server info section (fluff, really)
+/**
+ * \brief Server info section (fluff, really)
*/
void server_info_section(void) {
char message[512];
do_template("endbox");
}
+/**
+ * \brief summary of inner div????
+ */
void summary_inner_div(void) {
- /*
+ /**
* Now let's do three columns of crap. All portals and all groupware
* clients seem to want to do three columns, so we'll do three
* columns too. Conformity is not inherently a virtue, but there are
wprintf("<div class=\"fix_scrollbar_bug\">"
"<table border=0 width=100%%><tr valign=top>");
- /*
+ /**
* Column One
*/
wprintf("<td width=33%%>");
wholist_section();
- /*
+ /**
* Column Two
*/
wprintf("</td><td width=33%%>");
wprintf("<br />");
tasks_section();
- /*
+ /**
* Column Three
*/
wprintf("</td><td width=33%%>");
wprintf("<br />");
calendar_section();
- /*
+ /**
* End of columns
*/
wprintf("</td></tr></table>");
}
-/*
- * Display this user's summary page
+/**
+ * \brief Display this user's summary page
*/
void summary(void) {
char title[256];
offer_start_page();
wprintf("</TD></TR></TABLE>\n");
- /*
+ /**
* You guessed it ... we're going to refresh using ajax.
* In the future we might consider updating individual sections of the summary
* instead of the whole thing.
wDumpContent(1);
}
+
+
+/*@}*/
/*
* $Id$
- *
- * Editing of various text files on the Citadel server.
*/
-
+/**
+ * \defgroup ShowSysMsgs Editing of various text files on the Citadel server.
+ */
+/*@{*/
#include "webcit.h"
-/*
- * display the form for editing something (room info, bio, etc)
+/**
+ * \brief display the form for editing something (room info, bio, etc)
+ * \param description the descriptive text for the box
+ * \param check_cmd command to check????
+ * \param read_cmd read answer from citadel server???
+ * \param save_cmd save comand to the citadel server??
+ * \param with_room_banner should we bisplay a room banner?
*/
void display_edit(char *description, char *check_cmd,
char *read_cmd, char *save_cmd, int with_room_banner)
}
-/*
- * save a screen which was displayed with display_edit()
+/**
+ * \brief save a screen which was displayed with display_edit()
+ * \param description the window title???
+ * \param enter_cmd which command to enter at the citadel server???
+ * \param regoto should we go to that room again after executing that command?
*/
void save_edit(char *description, char *enter_cmd, int regoto)
{
return;
}
}
+
+
+/*@}*/
/*
* $Id: $
- *
- * Utility functions for creating tabbed dialogs
*/
-
+/**
+ * \defgroup TabUtils Utility functions for creating tabbed dialogs
+ */
+/*@{*/
#include "webcit.h"
+/**
+ * \brief print tabbed dialog
+ * \param num_tabs how many tabs do we have?
+ * \param tabnames the headers of the tables
+ */
void tabbed_dialog(int num_tabs, char *tabnames[]) {
int i;
wprintf("<table border=\"0\" width=\"100%%\" bgcolor=\"#ffffff\"><tr><td>");
}
+/**
+ * \brief print the tab-header
+ * \param tabnum number of the tab to print
+ * \param num_tabs total number oftabs to be printed
+ */
void begin_tab(int tabnum, int num_tabs) {
wprintf("<div id=\"tabdiv%d\" style=\"display:%s\">",
tabnum,
);
}
+/**
+ * \brief print the tab-footer
+ * \param tabnum number of the tab to print
+ * \param num_tabs total number oftabs to be printed
+ */
void end_tab(int tabnum, int num_tabs) {
wprintf("</div>\n");
wprintf("</td></tr></table>\n");
}
}
+
+
+/*@}*/
/*
* $Id$
- *
- * TCP client socket module for WebCit
+ */
+/**
+ * \defgroup TcpSockets TCP client socket module for WebCit
*
*/
+/*@{*/
/*
* Uncomment this to log all communications with the Citadel server
#include "webcit.h"
#include "webserver.h"
+/**
+ * \brief register the timeout
+ * \param signum signalhandler number
+ * \return signals
+ */
RETSIGTYPE timeout(int signum)
{
lprintf(1, "Connection timed out.\n");
}
-/*
- * Connect a unix domain socket
+/**
+ * \brief Connect a unix domain socket
+ * \param sockpath where to open a unix domain socket
*/
int uds_connectsock(char *sockpath)
{
}
-/*
- * Connect a TCP/IP socket
+/**
+ * \brief Connect a TCP/IP socket
+ * \param host the host to connect to
+ * \param service the service on the host to call
*/
int tcp_connectsock(char *host, char *service)
{
-/*
- * Input binary data from socket
+/**
+ * \brief Input binary data from socket
+ * \param buf the buffer to get the input to
+ * \param bytes the maximal number of bytes to read
*/
void serv_read(char *buf, int bytes)
{
}
-/*
- * input string from pipe
+/**
+ * \brief input string from pipe
*/
void serv_getln(char *strbuf, int bufsize)
{
-/*
- * send binary to server
+/**
+ * \brief send binary to server
+ * \param buf the buffer to write to citadel server
+ * \param nbytes how many bytes to send to citadel server
*/
void serv_write(char *buf, int nbytes)
{
}
-/*
- * send line to server
+/**
+ * \brief send line to server
+ * \param string the line to send to the citadel server
*/
void serv_puts(char *string)
{
}
-/*
- * convenience function to send stuff to the server
+/**
+ * \brief convenience function to send stuff to the server
+ * \param format the formatstring
+ * \param ... the entities to insert into format
*/
void serv_printf(const char *format,...)
{
lprintf(9, "<%s", buf);
#endif
}
+
+
+/*@}*/
/*
* $Id$
- *
- * Miscellaneous routines
+ */
+/**
+ * \defgroup MiscRout Miscellaneous routines
*/
+/*@{*/
#include "webcit.h"
#include "webserver.h"
-typedef unsigned char byte;
+typedef unsigned char byte; /**< byte data type */
-#define FALSE 0
-#define TRUE 1
+#define FALSE 0 /**< no. */
+#define TRUE 1 /**< yes. */
-static byte dtable[256]; /* base64 encode / decode table */
+static byte dtable[256]; /**< base64 encode / decode table */
+/**
+ * \brief sanitize strncopy.
+ * \param dest destination string
+ * \param src source string
+ * \param n length of source to copy
+ * \return result string
+ */
char *safestrncpy(char *dest, const char *src, size_t n)
{
if (dest == NULL || src == NULL) {
-/*
- * num_tokens() - discover number of parameters/tokens in a string
+/**
+ * \brief discover number of parameters/tokens in a string
+ * \param source string to inspect
+ * \param tok seperation token
+ * \return number of tokenized parts found
*/
int num_tokens(char *source, char tok)
{
return (count);
}
-/*
- * extract_token() - a string tokenizer
+/**
+ * brief a string tokenizer
+ * \param dest destination string
+ * \param source the string to grab tokens from
+ * \param parmnum the n'th token to grab
+ * \param separator the tokenizer string
+ * \param maxlen the length of dest
*/
void extract_token(char *dest, const char *source, int parmnum, char separator, int maxlen)
{
-/*
- * remove_token() - a tokenizer that kills, maims, and destroys
+/**
+ * \brief a tokenizer that kills, maims, and destroys
+ * \param source the string to process
+ * \param parmnum which token to kill
+ * \param separator the tokenizer string
*/
void remove_token(char *source, int parmnum, char separator)
{
-/*
- * extract_int() - extract an int parm w/o supplying a buffer
+/**
+ * \brief extract an int parm w/o supplying a buffer
+ * \param source the string to locate the int in
+ * \param parmnum the n'th token to grab the int from
+ * \return the integer
*/
int extract_int(const char *source, int parmnum)
{
return(atoi(buf));
}
-/*
- * extract_long() - extract an long parm w/o supplying a buffer
+/**
+ * \brief extract an long parm w/o supplying a buffer
+ * \param source string to examine
+ * \param parmnum n'th token to search long in
+ * \return the found long value
*/
long extract_long(const char *source, int parmnum)
{
-/*
- * check for the presence of a character within a string (returns count)
+/**
+ * \brief check for the presence of a character within a string (returns count)
+ * \param st the string to examine
+ * \param ch the char to search
+ * \return the position inside of st
*/
int haschar(st, ch)
char st[];
}
-/*
- * Utility function to "readline" from memory
- * (returns new pointer)
+/**
+ * \brief Utility function to "readline" from memory
+ * \param start position in buf
+ * \param buf the buffer to create string in???
+ * \param maxlen how big may the buffer get?
+ * \return new pointer to read string
*/
char *memreadline(char *start, char *buf, int maxlen)
{
char ch;
char *ptr;
- int len = 0; /* tally our own length to avoid strlen() delays */
+ int len = 0; /**< tally our own length to avoid strlen() delays */
ptr = start;
memset(buf, 0, maxlen);
-/*
- * pattern2() - searches for patn within search string, returns pos
+/**
+ * \brief searches for a paternn within asearch string
+ * \param search the string to search
+ * \param patn the pattern to find in string
+ * \returns position in string
*/
int pattern2(char *search, char *patn)
{
}
-/*
- * Strip leading and trailing spaces from a string
+/**
+ * \brief Strip leading and trailing spaces from a string
+ * \param buf the string to modify
*/
void striplt(char *buf)
{
}
-/*
- * Determine whether the specified message number is contained within the
+/**
+ * \brief Determine whether the specified message number is contained within the
* specified set.
+ * \param mset stringset???
+ * \param msgnum a citadel server indexnumber
+ * \return yes / no ???
*/
int is_msg_in_mset(char *mset, long msgnum) {
int num_sets;
-/*
- * Strip a boundarized substring out of a string (for example, remove
+/**
+ * \brief Strip a boundarized substring out of a string
+ * (for example, remove
* parentheses and anything inside them).
*
* This improved version can strip out *multiple* boundarized substrings.
+ * \param str the string to process
+ * \param leftboundary the boundary character on the left side of the target string
+ * \param rightboundary the boundary character on the right side of the target string
*/
void stripout(char *str, char leftboundary, char rightboundary)
{
-/*
- * Replacement for sleep() that uses select() in order to avoid SIGALRM
+/**
+ * \brief Replacement for sleep() that uses select() in order to avoid SIGALRM
+ * \param seconds how many seconds should we sleep?
*/
void sleeeeeeeeeep(int seconds)
{
-/*
+/**
+ * \brief encode a string into base64 to for example tunnel it through mail transport
* CtdlDecodeBase64() and CtdlEncodeBase64() are adaptations of code by
* John Walker, copied over from the Citadel server.
+ * \param dest encrypted string
+ * \param source the string to encrypt
+ * \param sourcelen the length of the source data (may contain string terminators)
*/
void CtdlEncodeBase64(char *dest, const char *source, size_t sourcelen)
int dpos = 0;
int thisline = 0;
- /* Fill dtable with character encodings. */
+ /** Fill dtable with character encodings. */
for (i = 0; i < 26; i++) {
dtable[i] = 'A' + i;
(igroup[2] >> 6)];
ogroup[3] = dtable[igroup[2] & 0x3F];
- /* Replace characters in output stream with "=" pad
- characters if fewer than three characters were
- read from the end of the input stream. */
+ /**
+ * Replace characters in output stream with "=" pad
+ * characters if fewer than three characters were
+ * read from the end of the input stream.
+ */
if (n < 3) {
ogroup[3] = '=';
}
-/*
- * Convert base64-encoded to binary. Returns the length of the decoded data.
+/**
+ * \brief Convert base64-encoded to binary.
* It will stop after reading 'length' bytes.
+ * \param dest the destination buffer
+ * \param source the encrypted string
+ * \param length the maximal length of dest???
+ * \return the length actual length of the decoded data.
*/
int CtdlDecodeBase64(char *dest, const char *source, size_t length)
{
dtable['/'] = 63;
dtable['='] = 0;
- /*CONSTANTCONDITION*/ while (TRUE) {
+ /**CONSTANTCONDITION*/ while (TRUE) {
byte a[4], b[4], o[3];
for (i = 0; i < 4; i++) {
return (dpos);
}
if (dtable[c] & 0x80) {
- /* Ignoring errors: discard invalid character */
+ /** Ignoring errors: discard invalid character */
i--;
continue;
}
-/*
- * Generate a new, globally unique UID parameter for a calendar etc. object
+/**
+ * \brief Generate a new, globally unique UID parameter for a calendar etc. object
+ * \param buf uid to create ????
*/
void generate_uuid(char *buf) {
static int seq = 0;
}
-/*
- * Local replacement for controversial C library function that generates
+/**
+ * \brief Local replacement for controversial C library function that generates
* names for temporary files. Included to shut up compiler warnings.
+ * \todo return a fd to the file instead of the name for security reasons
+ * \param name the created filename
+ * \param len the length of the filename
*/
void CtdlMakeTempFileName(char *name, int len) {
int i = 0;
}
}
}
+
+
+
+/*@}*/
/*
* $Id$
- *
- * Administrative screen to add/change/delete user accounts
+ */
+/**
+ * \defgroup AdminTasks Administrative screen to add/change/delete user accounts
*
*/
-
+/*@{*/
#include "webcit.h"
#include "webserver.h"
+/**
+ * \brief show a list of available users to edit them
+ * \param message the header message???
+ * \param preselect which user should be selected in the browser
+ */
void select_user_to_edit(char *message, char *preselect)
{
char buf[SIZ];
-/*
- * Locate the message number of a user's vCard in the current room
+/**
+ * \brief Locate the message number of a user's vCard in the current room
+ * \param username the plaintext name of the user
+ * \param usernum the number of the user on the citadel server
+ * \return the message id of his vcard
*/
long locate_user_vcard(char *username, long usernum) {
char buf[SIZ];
struct stuff_t *ptr;
TRYAGAIN:
- /* Search for the user's vCard */
+ /** Search for the user's vCard */
serv_puts("MSGS ALL");
serv_getln(buf, sizeof buf);
if (buf[0] == '1') while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
stuff = ptr;
}
- /* Iterate through the message list looking for vCards */
+ /** Iterate through the message list looking for vCards */
while (stuff != NULL) {
serv_printf("MSG0 %ld|2", stuff->msgnum);
serv_getln(buf, sizeof buf);
stuff = ptr;
}
- /* If there's no vcard, create one */
+ /** If there's no vcard, create one */
if (vcard_msgnum < 0) if (already_tried_creating_one == 0) {
already_tried_creating_one = 1;
serv_puts("ENT0 1|||4");
}
-/*
- * Display the form for editing a user's address book entry
+/**
+ * \brief Display the form for editing a user's address book entry
+ * \param username the name of the user
+ * \param usernum the citadel-uid of the user
*/
void display_edit_address_book_entry(char *username, long usernum) {
char roomname[SIZ];
char error_message[SIZ];
long vcard_msgnum = (-1L);
- /* Locate the user's config room, creating it if necessary */
+ /** Locate the user's config room, creating it if necessary */
sprintf(roomname, "%010ld.%s", usernum, USERCONFIGROOM);
serv_printf("GOTO %s||1", roomname);
serv_getln(buf, sizeof buf);
-/*
- * Edit a user. If supplied_username is null, look in the "username"
+/**
+ * \brief Edit a user.
+ * If supplied_username is null, look in the "username"
* web variable for the name of the user to edit.
*
* If "is_new" is set to nonzero, this screen will set the web variables
* to send the user to the vCard editor next.
+ * \param supplied_username user to look up or NULL if to search in the environment
+ * \param is_new should we create the user?
*/
void display_edituser(char *supplied_username, int is_new) {
char buf[1024];
}
-
+/**
+ * \brief do the backend operation of the user edit on the server
+ */
void edituser(void) {
char message[SIZ];
char buf[SIZ];
}
}
- /* If we are in the middle of creating a new user, move on to
+ /**
+ * If we are in the middle of creating a new user, move on to
* the vCard edit screen.
*/
if (is_new) {
}
}
-
+/**
+ * \brief burge a user
+ * \param username the name of the user to remove
+ */
void delete_user(char *username) {
char buf[SIZ];
char message[SIZ];
-
+/**
+ * \brief create a new user
+ * take the web environment username and create it on the citadel server
+ */
void create_user(void) {
char buf[SIZ];
char error_message[SIZ];
}
+
+
+/*@}*/
/*
* $Id$
- *
- * Display a list of all accounts on a Citadel system.
+ */
+/**
+ * \defgroup AccDisplay Display a list of all accounts on a Citadel system.
*
*/
+/*@{*/
#include "webcit.h"
+/**
+ * \brief structure to keep namelists in
+ */
struct namelist {
- struct namelist *next;
- char name[32];
+ struct namelist *next; /**< next item of the linked list */
+ char name[32]; /**< name of the userentry */
};
-/*
- * display the userlist
+/**
+ * \brief display the userlist
*/
void userlist(void)
{
}
-/*
- * Display (non confidential) information about a particular user
+/**
+ * \brief Display (non confidential) information about a particular user
*/
void showuser(void)
{
wprintf("</td></tr></table></div>\n");
wDumpContent(1);
}
+
+
+/*@}*/
/*
* $Id$
- *
- * vCard data type implementation for the Citadel system.
+ */
+/**
+ * \defgroup VCardMain vCard data type implementation for the Citadel system.
*
* Copyright (C) 1999-2005 by Art Cancro
* This code is freely redistributable under the terms of the GNU General
* Public License. All other rights reserved.
*/
-
+/*@{*/
#include "webcit.h"
#include "webserver.h"
#include "vcard.h"
-/*
- * Constructor (empty vCard)
+/**
+ * \brief Constructor (empty vCard)
+ * \return an empty vcard
*/
struct vCard *vcard_new() {
struct vCard *v;
}
-/*
- * Constructor (supply serialized vCard)
+/**
+ * \brief Constructor (supply serialized vCard)
+ * \param vtext the text to parse into the new vcard
+ * \return the parsed VCard
*/
struct vCard *vcard_load(char *vtext) {
struct vCard *v;
mycopy = strdup(vtext);
if (mycopy == NULL) return NULL;
- /* First, fix this big pile o' vCard to make it more parseable.
+ /**
+ * First, fix this big pile o' vCard to make it more parseable.
* To make it easier to parse, we convert CRLF to LF, and unfold any
* multi-line fields into single lines.
*/
}
-/*
- * Fetch the value of a particular key.
+/**
+ * \brief Fetch the value of a particular key.
* If is_partial is set to 1, a partial match is ok (for example,
* a key of "tel;home" will satisfy a search for "tel").
* Set "instance" to a value higher than 0 to return subsequent instances
* of the same key.
* Set "get_propname" to nonzero to fetch the property name instead of value.
+ * \param v vCard to get keyvalue from
+ * \param propname key to retrieve
+ * \param is_partial dunno???
+ * \param instance if >0 return a later token of the value
+ * \param get_propname if nonzero get the real property name???
+ * \return the requested value / token / propertyname
*/
char *vcard_get_prop(struct vCard *v, char *propname,
int is_partial, int instance, int get_propname) {
-/*
- * Destructor
+/**
+ * \brief Destructor
+ * kill a vCard
+ * \param v the vCard to purge from memory
*/
void vcard_free(struct vCard *v) {
int i;
-/*
- * Set a name/value pair in the card
+/**
+ * \brief Set a name/value pair in the card
+ * \param v vCard to inspect
+ * \param name key to set
+ * \param value the value to assign to key
+ * \param append should we append the value to an existing one?
*/
void vcard_set_prop(struct vCard *v, char *name, char *value, int append) {
int i;
- if (v->magic != CTDL_VCARD_MAGIC) return; /* Self-check */
+ if (v->magic != CTDL_VCARD_MAGIC) return; /** Self-check */
- /* If this key is already present, replace it */
+ /** If this key is already present, replace it */
if (!append) if (v->numprops) for (i=0; i<(v->numprops); ++i) {
if (!strcasecmp(v->prop[i].name, name)) {
free(v->prop[i].name);
}
}
- /* Otherwise, append it */
+ /** Otherwise, append it */
++v->numprops;
v->prop = realloc(v->prop,
(v->numprops * sizeof(struct vCardProp)) );
-/*
- * Serialize a struct vcard into a standard text/x-vcard MIME type.
- *
+/**
+ * \brief Serialize a struct vcard into a standard text/x-vcard MIME type.
+ * \param v vCard to serialize
+ * \return the serialized vCard
*/
char *vcard_serialize(struct vCard *v)
{
int i;
size_t len;
- if (v->magic != CTDL_VCARD_MAGIC) return NULL; /* self check */
+ if (v->magic != CTDL_VCARD_MAGIC) return NULL; /** self check */
- /* Figure out how big a buffer we need to allocate */
- len = 64; /* for begin, end, and a little padding for safety */
+ /** Figure out how big a buffer we need to allocate */
+ len = 64; /** for begin, end, and a little padding for safety */
if (v->numprops) for (i=0; i<(v->numprops); ++i) {
len = len +
strlen(v->prop[i].name) +
return ser;
}
+
+
+
+/*@}*/
/*
* $Id$
- *
- * vCard implementation for Citadel
+ */
+/**
+ * \defgroup VcardHeader vCard implementation for Citadel
*
* Copyright (C) 1999 by Art Cancro
* This code is freely redistributable under the terms of the GNU General
* Public License. All other rights reserved.
*/
+/*@{ */
+#define CTDL_VCARD_MAGIC 0xa1f9 /**< magic byte vcards start with??? */
-#define CTDL_VCARD_MAGIC 0xa1f9
-
-/*
- * This data structure represents a vCard object currently in memory.
+/**
+ * \brief This data structure represents a vCard object currently in memory.
*/
struct vCard {
- int magic;
- int numprops;
- struct vCardProp {
- char *name;
- char *value;
- } *prop;
+ int magic; /**< the Magic Byte */
+ int numprops; /**< number of properties this vcard will have */
+ struct vCardProp {
+ char *name; /**< Keyname of the property */
+ char *value; /**< value of the property */
+ } *prop; /**< Vcard Property. Linked list??? */
};
char *vcard_get_prop(struct vCard *v, char *propname, int is_partial,
int instance, int return_propname);
char *vcard_serialize(struct vCard *);
+
+
+/*@}*/
/*
* $Id$
- *
- * Handles on-screen editing of vCard objects.
- *
*/
-
+/**
+ * \defgroup vCardEdit Handles on-screen editing of vCard objects.
+ * \ingroup WebFrontend
+ */
+/*@{*/
#include "webcit.h"
#include "vcard.h"
-/* Edit the vCard component of a MIME message. Supply the message number
+/**
+ * \brief Edit the vCard component of a MIME message.
+ * Supply the message number
* and MIME part number to fetch. Or, specify -1 for the message number
* to start with a blank card.
+ * \param msgnum number of the item on the citadel server
+ * \param partnum what???
+ * \param return_to where to go back in the browser after edit ????
*/
void do_edit_vcard(long msgnum, char *partnum, char *return_to) {
char buf[SIZ];
vcard_free(v);
}
- /* Display the form */
+ /** Display the form */
output_headers(1, 1, 2, 0, 0, 0);
wprintf("<div id=\"banner\">\n"
"<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
}
-
+/**
+ * \brief commit the edits to the citadel server
+ */
void edit_vcard(void) {
long msgnum;
char *partnum;
-
+/**
+ * \brief parse edited vcard from the browser
+ */
void submit_vcard(void) {
char buf[SIZ];
int i;
readloop("readnew");
}
}
+
+
+
+/*@}*/
/*
* $Id$
- *
- * This is the main transaction loop of the web service. It maintains a
+ */
+/**
+ * \defgroup MainServer This is the main transaction loop of the web service. It maintains a
* persistent session to the Citadel server, handling HTTP WebCit requests as
* they arrive and presenting a user interface.
- *
+ * \ingroup BackendWebServer
*/
-
+/*@{*/
#include "webcit.h"
#include "groupdav.h"
#include "webserver.h"
#include "mime_parser.h"
-/*
+/**
* Subdirectories from which the client may request static content
*/
char *static_content_dirs[] = {
- "static",
- "tiny_mce"
+ "static", /** static templates */
+ "tiny_mce" /** the JS editor */
};
-/*
+/**
* String to unset the cookie.
* Any date "in the past" will work, so I chose my birthday, right down to
* the exact minute. :)
*/
static char *unset = "; expires=28-May-1971 18:10:00 GMT";
+/**
+ * \brief remove escaped strings from i.e. the url string (like %20 for blanks)
+ * \param buf the buffer to examine
+ */
void unescape_input(char *buf)
{
int a, b;
}
-
+/**
+ * \brief add urls???
+ * \param url what???
+ */
void addurls(char *url)
{
char *up, *ptr;
up = url;
while (strlen(up) > 0) {
- /* locate the = sign */
+ /** locate the = sign */
safestrncpy(buf, up, sizeof buf);
b = (-1);
for (a = 255; a >= 0; --a)
WC->urlstrings = u;
safestrncpy(u->url_key, buf, sizeof u->url_key);
- /* now chop that part off */
+ /** now chop that part off */
for (a = 0; a <= b; ++a)
++up;
- /* locate "&" and "?" delimiters */
+ /** locate "&" and "?" delimiters */
ptr = up;
b = strlen(up);
for (a = 0; a < strlen(up); ++a) {
}
}
+/**
+ * \brief free urlstring memory
+ */
void free_urls(void)
{
struct urlcontent *u;
}
}
-/*
- * Diagnostic function to display the contents of all variables
+/**
+ * \brief Diagnostic function to display the contents of all variables
*/
void dump_vars(void)
{
}
}
+/**
+ * \brief what???
+ * \param key what???
+ */
char *bstr(char *key)
{
struct urlcontent *u;
return ("");
}
-
+/**
+ * \brief web-printing funcion. uses our vsnprintf wrapper
+ * \param format printf format string
+ * \param ... the varargs to put into formatstring
+ */
void wprintf(const char *format,...)
{
va_list arg_ptr;
}
-/*
- * wDumpContent() wraps up an HTTP session, closes tags, etc.
- *
- * print_standard_html_footer should be set to 0 to transmit only, 1 to
+/**
+ * \brief wrap up an HTTP session, closes tags, etc.
+ * \todo multiline params?
+ * \param print_standard_html_footer should be set to 0 to transmit only, 1 to
* append the main menu and closing tags, or 2 to
* append the closing tags only.
*/
}
-/*
- * Copy a string, escaping characters which have meaning in HTML. If
- * nbsp is nonzero, spaces are converted to non-breaking spaces.
+/**
+ * \brief Copy a string, escaping characters which have meaning in HTML.
+ * \param target target buffer to copy to
+ * \param strbuf source buffer ???
+ * \param nbsp If nonzero, spaces are converted to non-breaking spaces.
+ * \param nolinebreaks if set, linebreaks are removed from the string.
*/
void stresc(char *target, char *strbuf, int nbsp, int nolinebreaks)
{
}
}
+/**
+ * \brief WHAT???
+ * \param strbuf what???
+ * \param nbsp If nonzero, spaces are converted to non-breaking spaces.
+ * \param nolinebreaks if set, linebreaks are removed from the string.
+ */
void escputs1(char *strbuf, int nbsp, int nolinebreaks)
{
char *buf;
free(buf);
}
+/**
+ * \brief static wrapper for ecsputs1
+ * \param strbuf buffer to print escaped to client
+ */
void escputs(char *strbuf)
{
escputs1(strbuf, 0, 0);
}
-/*
- * Escape a string for feeding out as a URL.
+/**
+ * \brief Escape a string for feeding out as a URL.
* Returns a pointer to a buffer that must be freed by the caller!
+ * \param outbuf the outputbuffer
+ * \param strbuf the input buffer???
*/
void urlesc(char *outbuf, char *strbuf)
{
}
}
+/**
+ * \brief urlescape buffer and print it to the client
+ * \param strbuf buffer to urlescape
+ */
void urlescputs(char *strbuf)
{
char outbuf[SIZ];
}
-/*
- * Copy a string, escaping characters for JavaScript strings.
+/**
+ * \brief Copy a string, escaping characters for JavaScript strings.
+ * \param target output string
+ * \param strbuf input string
*/
void jsesc(char *target, char *strbuf)
{
}
}
+/**
+ * \brief escape and print java script
+ * \param strbuf the js code
+ */
void jsescputs(char *strbuf)
{
char outbuf[SIZ];
wprintf("%s", outbuf);
}
-/*
- * Copy a string, escaping characters for message text hold
+/**
+ * \brief Copy a string, escaping characters for message text hold
+ * \param target target buffer
+ * \param strbuf source buffer
*/
void msgesc(char *target, char *strbuf)
{
}
}
+/**
+ * \brief print message to the client ???
+ * \param strbuf message to print???
+ */
void msgescputs(char *strbuf) {
char *outbuf;
-/*
- * Output all that important stuff that the browser will want to see
+/**
+ * \brief Output all that important stuff that the browser will want to see
*/
-void output_headers( int do_httpheaders, /* 1 = output HTTP headers */
- int do_htmlhead, /* 1 = output HTML <head> section and <body> opener */
+void output_headers( int do_httpheaders, /**< 1 = output HTTP headers */
+ int do_htmlhead, /**< 1 = output HTML <head> section and <body> opener */
- int do_room_banner, /* 0=no, 1=yes, */
- /* 2 = I'm going to embed my own, so don't open the */
- /* <div id="content"> either. */
+ int do_room_banner, /**< 0=no, 1=yes,
+ * 2 = I'm going to embed my own, so don't open the
+ * <div id="content"> either.
+ */
- int unset_cookies, /* 1 = session is terminating, so unset the cookies */
- int suppress_check, /* 1 = suppress check for instant messages */
- int cache /* 1 = allow browser to cache this page */
+ int unset_cookies, /**< 1 = session is terminating, so unset the cookies */
+ int suppress_check, /**< 1 = suppress check for instant messages */
+ int cache /**< 1 = allow browser to cache this page */
) {
char cookie[SIZ];
char httpnow[SIZ];
do_template("head");
}
- /* ICONBAR */
+ /** ICONBAR */
if (do_htmlhead) {
- /* check for ImportantMessages (these display in a div overlaying the main screen) */
+ /** check for ImportantMessages (these display in a div overlaying the main screen) */
if (strlen(WC->ImportantMessage) > 0) {
wprintf("<div id=\"important_message\">\n");
wprintf("<SPAN CLASS=\"imsg\">"
if ( (WC->logged_in) && (!unset_cookies) ) {
wprintf("<div id=\"iconbar\">");
do_selected_iconbar();
- /* check for instant messages (these display in a new window)
+ /** check for instant messages (these display in a new window)
page_popup(); */
wprintf("</div>");
}
}
-/*
- * Generic function to do an HTTP redirect. Easy and fun.
+/**
+ * \brief Generic function to do an HTTP redirect. Easy and fun.
+ * \param whichpage target url to 302 to
*/
void http_redirect(char *whichpage) {
wprintf("HTTP/1.1 302 Moved Temporarily\n");
-/*
- * Output a piece of content to the web browser
+/**
+ * \brief Output a piece of content to the web browser
*/
void http_transmit_thing(char *thing, size_t length, char *content_type,
int is_static) {
SERVER);
#ifdef HAVE_ZLIB
- /* If we can send the data out compressed, please do so. */
+ /** If we can send the data out compressed, please do so. */
if (WC->gzip_ok) {
char *compressed_data = NULL;
uLongf compressed_len;
}
#endif
- /* No compression ... just send it out as-is */
+ /** No compression ... just send it out as-is */
wprintf("Content-length: %ld\r\n"
"\r\n",
(long) length
-
+/**
+ * \brief dump out static pages from disk
+ * \param what the file urs to print
+ */
void output_static(char *what)
{
FILE *fp;
}
-/*
- * When the browser requests an image file from the Citadel server,
+/**
+ * \brief When the browser requests an image file from the Citadel server,
* this function is called to transmit it.
*/
void output_image()
bytes = extract_long(&buf[4], 0);
xferbuf = malloc(bytes + 2);
- /* Read it from the server */
+ /** Read it from the server */
read_server_binary(xferbuf, bytes);
serv_puts("CLOS");
serv_getln(buf, sizeof buf);
- /* Write it to the browser */
+ /** Write it to the browser */
http_transmit_thing(xferbuf, (size_t)bytes, "image/gif", 0);
free(xferbuf);
} else {
- /* Instead of an ugly 404, send a 1x1 transparent GIF
+ /**
+ * Instead of an ugly 404, send a 1x1 transparent GIF
* when there's no such image on the server.
*/
output_static("static/blank.gif");
}
-/*
- * Generic function to output an arbitrary MIME part from an arbitrary
+/**
+ * \brief Generic function to output an arbitrary MIME part from an arbitrary
* message number on the server.
+ * \param msgnum number of the item on the citadel server
+ * \param partnum the partnumber???
*/
void mimepart(char *msgnum, char *partnum)
{
}
-/*
- * Read any MIME part of a message, from the server, into memory.
+/**
+ * \brief Read any MIME part of a message, from the server, into memory.
+ * \param msgnum number of the message on the citadel server
+ * \param partnum the part number???
*/
char *load_mimepart(long msgnum, char *partnum)
{
}
-/*
- * Convenience functions to display a page containing only a string
+/**
+ * \brief Convenience functions to display a page containing only a string
+ * \param titlebarcolor color of the titlebar of the frame
+ * \param titlebarmsg text to display in the title bar
+ * \param messagetext body of the box
*/
void convenience_page(char *titlebarcolor, char *titlebarmsg, char *messagetext)
{
}
-/*
- * Display a blank page.
+/**
+ * \brief Display a blank page.
*/
void blank_page(void) {
output_headers(1, 1, 0, 0, 0, 0);
}
-/*
- * A template has been requested
+/**
+ * \brief A template has been requested
*/
void url_do_template(void) {
do_template(bstr("template"));
-/*
- * Offer to make any page the user's "start page."
+/**
+ * \brief Offer to make any page the user's "start page."
*/
void offer_start_page(void) {
wprintf("<a href=\"change_start_page?startpage=");
}
-/*
- * Change the user's start page
+/**
+ * \brief Change the user's start page
*/
void change_start_page(void) {
-
+/**
+ * \brief display the successfull edit or s.th. lisket hat ???
+ * \param successmessage the mesage itself
+ */
void display_success(char *successmessage)
{
convenience_page("007700", "OK", successmessage);
}
-/* Authorization required page */
-/* This is probably temporary and should be revisited */
+/**
+ * \brief Authorization required page
+ * This is probably temporary and should be revisited
+ * \param message message to put in header
+*/
void authorization_required(const char *message)
{
wprintf("HTTP/1.1 401 Authorization Required\r\n");
wDumpContent(0);
}
-
+/**
+ * \brief handle file uploads
+ * \param name the url the upload is done to
+ * \param filename the name of the file being uploaded
+ * \param partnum item number on the citadel server ???
+ * \param disp what???
+ * \param content the file contents???
+ * \param cbtype what???
+ * \param cbcharset the character set of cb??
+ * \param length the size of the file ???
+ * \param encoding charset encoding of the file??
+ * \param userdata what???
+ */
void upload_handler(char *name, char *filename, char *partnum, char *disp,
void *content, char *cbtype, char *cbcharset,
size_t length, char *encoding, void *userdata)
u->url_data[length] = 0;
}
- /* Uploaded files */
+ /** Uploaded files */
if ( (length > 0) && (strlen(cbtype) > 0) ) {
WC->upload = malloc(length);
if (WC->upload != NULL) {
}
-/*
- * Convenience functions to wrap around asynchronous ajax responses
+/**
+ * \brief Convenience functions to wrap around asynchronous ajax responses
*/
void begin_ajax_response(void) {
output_headers(0, 0, 0, 0, 0, 0);
begin_burst();
}
+/**
+ * \brief print ajax response footer
+ */
void end_ajax_response(void) {
wprintf("\r\n");
wDumpContent(0);
}
+/**
+ * \brief parse server command to execute on the citadel
+ */
void ajax_servcmd(void)
{
char buf[1024];
end_ajax_response();
- /* This is kind of an ugly hack, but this is the only place it can go.
+ /**
+ * This is kind of an ugly hack, but this is the only place it can go.
* If the command was GEXP, then the instant messenger window must be
* running, so reset the "last_pager_check" watchdog timer so
* that page_popup() doesn't try to open it a second time.
}
-/*
- * Helper function for the asynchronous check to see if we need
+/**
+ * \brief Helper function for the asynchronous check to see if we need
* to open the instant messenger window.
*/
void seconds_since_last_gexp(void)
-/*
- * Entry point for WebCit transaction
+/**
+ * \brief Entry point for WebCit transaction
*/
void session_loop(struct httprequest *req)
{
int body_start = 0;
int is_static = 0;
- /* We stuff these with the values coming from the client cookies,
+ /**
+ * We stuff these with the values coming from the client cookies,
* so we can use them to reconnect a timed out session if we have to.
*/
char c_username[SIZ];
extract_token(request_method, cmd, 0, ' ', sizeof request_method);
extract_token(pathname, cmd, 1, ' ', sizeof pathname);
- /* Figure out the action */
+ /** Figure out the action */
extract_token(action, pathname, 1, '/', sizeof action);
if (strstr(action, "?")) *strstr(action, "?") = 0;
if (strstr(action, "&")) *strstr(action, "&") = 0;
}
striplt(browser_host);
}
- /* Only WAP gateways explicitly name this content-type */
+ /** Only WAP gateways explicitly name this content-type */
else if (strstr(buf, "text/vnd.wap.wml")) {
WC->is_wap = 1;
}
ContentType, ContentLength);
body_start = strlen(content);
- /* Read the entire input data at once. */
+ /** Read the entire input data at once. */
client_read(WC->http_sock, &content[BytesRead+body_start],
ContentLength);
content = NULL;
}
- /* make a note of where we are in case the user wants to save it */
+ /** make a note of where we are in case the user wants to save it */
safestrncpy(WC->this_page, cmd, sizeof(WC->this_page));
remove_token(WC->this_page, 2, ' ');
remove_token(WC->this_page, 0, ' ');
- /* If there are variables in the URL, we must grab them now */
+ /** If there are variables in the URL, we must grab them now */
for (a = 0; a < strlen(cmd); ++a) {
if ((cmd[a] == '?') || (cmd[a] == '&')) {
for (b = a; b < strlen(cmd); ++b)
}
- /* Static content can be sent without connecting to Citadel. */
+ /** Static content can be sent without connecting to Citadel. */
is_static = 0;
for (a=0; a<(sizeof(static_content_dirs) / sizeof(char *)); ++a) {
if (!strcasecmp(action, static_content_dirs[a])) {
goto SKIP_ALL_THIS_CRAP; /* Don't try to connect */
}
- /*
+ /**
* If we're not connected to a Citadel server, try to hook up the
* connection now.
*/
}
else {
WC->connected = 1;
- serv_getln(buf, sizeof buf); /* get the server welcome message */
+ serv_getln(buf, sizeof buf); /** get the server welcome message */
- /* From what host is our user connecting? Go with
+ /**
+ * From what host is our user connecting? Go with
* the host at the other end of the HTTP socket,
* unless we are following X-Forwarded-For: headers
* and such a header has already turned up something.
}
}
- /*
+ /**
* Functions which can be performed without logging in
*/
if (!strcasecmp(action, "listsub")) {
}
#endif
- /*
+ /**
* If we're not logged in, but we have HTTP Authentication data,
* try logging in to Citadel using that.
*/
safestrncpy(WC->httpauth_user, c_httpauth_user, sizeof WC->httpauth_user);
safestrncpy(WC->httpauth_pass, c_httpauth_pass, sizeof WC->httpauth_pass);
} else {
- /* Should only display when password is wrong */
+ /** Should only display when password is wrong */
authorization_required(&buf[4]);
goto SKIP_ALL_THIS_CRAP;
}
}
}
- /* This needs to run early */
+ /** This needs to run early */
if (!strcasecmp(action, "rss")) {
display_rss(bstr("room"), request_method);
goto SKIP_ALL_THIS_CRAP;
}
- /*
+ /**
* The GroupDAV stuff relies on HTTP authentication instead of
* our session's authentication.
*/
}
- /*
+ /**
* Automatically send requests with any method other than GET or
* POST to the GroupDAV code as well.
*/
if ((strcasecmp(request_method, "GET")) && (strcasecmp(request_method, "POST"))) {
- groupdav_main(req, ContentType, /* do GroupDAV methods */
+ groupdav_main(req, ContentType, /** do GroupDAV methods */
ContentLength, content+body_start);
if (!WC->logged_in) {
- WC->killthis = 1; /* If not logged in, don't */
- } /* keep the session active */
+ WC->killthis = 1; /** If not logged in, don't */
+ } /** keep the session active */
goto SKIP_ALL_THIS_CRAP;
}
- /*
+ /**
* If we're not logged in, but we have username and password cookies
* supplied by the browser, try using them to log in.
*/
}
}
}
- /*
+ /**
* If we don't have a current room, but a cookie specifying the
* current room is supplied, make an effort to go there.
*/
if (!strcasecmp(action, "image")) {
output_image();
- /*
- * All functions handled below this point ... make sure we log in
- * before doing anything else!
- */
+ /**
+ * All functions handled below this point ... make sure we log in
+ * before doing anything else!
+ */
} else if ((!WC->logged_in) && (!strcasecmp(action, "login"))) {
do_login();
} else if (!WC->logged_in) {
display_login(NULL);
}
- /*
+ /**
* Various commands...
*/
wDumpContent(1);
}
- /* When all else fais, display the main menu. */
+ /** When all else fais, display the main menu. */
else {
display_main_menu();
}
WC->upload_length = 0;
}
}
+
+
+/*@}*/
*
* bucket one...
*/
-#define QR_PERMANENT 1 /* Room does not purge */
-#define QR_INUSE 2 /* Set if in use, clear if avail */
-#define QR_PRIVATE 4 /* Set for any type of private room */
-#define QR_PASSWORDED 8 /* Set if there's a password too */
-#define QR_GUESSNAME 16 /* Set if it's a guessname room */
-#define QR_DIRECTORY 32 /* Directory room */
-#define QR_UPLOAD 64 /* Allowed to upload */
-#define QR_DOWNLOAD 128 /* Allowed to download */
-#define QR_VISDIR 256 /* Visible directory */
-#define QR_ANONONLY 512 /* Anonymous-Only room */
-#define QR_ANONOPT 1024 /* Anonymous-Option room */
-#define QR_NETWORK 2048 /* Shared network room */
-#define QR_PREFONLY 4096 /* Preferred status needed to enter */
-#define QR_READONLY 8192 /* Aide status required to post */
-#define QR_MAILBOX 16384 /* Set if this is a private mailbox */
-
-/*
+#define QR_PERMANENT 1 /**< Room does not purge */
+#define QR_INUSE 2 /**< Set if in use, clear if avail */
+#define QR_PRIVATE 4 /**< Set for any type of private room */
+#define QR_PASSWORDED 8 /**< Set if there's a password too */
+#define QR_GUESSNAME 16 /**< Set if it's a guessname room */
+#define QR_DIRECTORY 32 /**< Directory room */
+#define QR_UPLOAD 64 /**< Allowed to upload */
+#define QR_DOWNLOAD 128 /**< Allowed to download */
+#define QR_VISDIR 256 /**< Visible directory */
+#define QR_ANONONLY 512 /**< Anonymous-Only room */
+#define QR_ANONOPT 1024 /**< Anonymous-Option room */
+#define QR_NETWORK 2048 /**< Shared network room */
+#define QR_PREFONLY 4096 /**< Preferred status needed to enter */
+#define QR_READONLY 8192 /**< Aide status required to post */
+#define QR_MAILBOX 16384 /**< Set if this is a private mailbox */
+
+/**
* bucket two...
*/
-#define QR2_SYSTEM 1 /* System room; hide by default */
-#define QR2_SELFLIST 2 /* Self-service mailing list mgmt */
+#define QR2_SYSTEM 1 /**< System room; hide by default */
+#define QR2_SELFLIST 2 /**< Self-service mailing list mgmt */
-/*
+/**
* user/room access
*/
#define UA_KNOWN 2
#define UA_ZAPPED 16
-/*
+/**
* User flags (from Citadel)
*/
-#define US_NEEDVALID 1 /* User needs to be validated */
-#define US_PERM 4 /* Permanent user */
-#define US_LASTOLD 16 /* Print last old message with new */
-#define US_EXPERT 32 /* Experienced user */
-#define US_UNLISTED 64 /* Unlisted userlog entry */
-#define US_NOPROMPT 128 /* Don't prompt after each message */
-#define US_PROMPTCTL 256 /* <N>ext & <S>top work at prompt */
-#define US_DISAPPEAR 512 /* Use "disappearing msg prompts" */
-#define US_REGIS 1024 /* Registered user */
-#define US_PAGINATOR 2048 /* Pause after each screen of text */
-#define US_INTERNET 4096 /* Internet mail privileges */
-#define US_FLOORS 8192 /* User wants to see floors */
-#define US_COLOR 16384 /* User wants ANSI color support */
+#define US_NEEDVALID 1 /**< User needs to be validated */
+#define US_PERM 4 /**< Permanent user */
+#define US_LASTOLD 16 /**< Print last old message with new */
+#define US_EXPERT 32 /**< Experienced user */
+#define US_UNLISTED 64 /**< Unlisted userlog entry */
+#define US_NOPROMPT 128 /**< Don't prompt after each message */
+#define US_PROMPTCTL 256 /**< <N>ext & <S>top work at prompt */
+#define US_DISAPPEAR 512 /**< Use "disappearing msg prompts" */
+#define US_REGIS 1024 /**< Registered user */
+#define US_PAGINATOR 2048 /**< Pause after each screen of text */
+#define US_INTERNET 4096 /**< Internet mail privileges */
+#define US_FLOORS 8192 /**< User wants to see floors */
+#define US_COLOR 16384 /**< User wants ANSI color support */
#define US_USER_SET (US_LASTOLD | US_EXPERT | US_UNLISTED | \
US_NOPROMPT | US_DISAPPEAR | US_PAGINATOR | \
US_FLOORS | US_COLOR | US_PROMPTCTL )
-
+/** \brief http request struct ??? */
struct httprequest {
- struct httprequest *next;
- char line[SIZ];
+ struct httprequest *next; /**< the next request in the list ??? */
+ char line[SIZ]; /**< the request line ??? */
};
+/**
+ * \brief contents of an url???
+ */
struct urlcontent {
- struct urlcontent *next;
- char url_key[32];
- char *url_data;
+ struct urlcontent *next; /**< the next url in the list */
+ char url_key[32]; /**< the url directory part */
+ char *url_data; /**< the url data part ??? */
};
+/**
+ * \brief information about us ???
+ */
struct serv_info {
- int serv_pid;
- char serv_nodename[32];
- char serv_humannode[64];
- char serv_fqdn[64];
- char serv_software[64];
- int serv_rev_level;
- char serv_bbs_city[64];
- char serv_sysadm[64];
- char serv_moreprompt[SIZ];
- int serv_ok_floors;
- int serv_supports_ldap;
+ int serv_pid; /**< Our process id */
+ char serv_nodename[32]; /**< How is the name of this citadel */
+ char serv_humannode[64]; /**< How is the human readable name of this citadel */
+ char serv_fqdn[64]; /**< How is our Full quallified Domain Name (uncensored.citadel.org ie.e */
+ char serv_software[64]; /**< What version does our connected citadel server use */
+ int serv_rev_level; /**< Whats the citadel server revision */
+ char serv_bbs_city[64]; /**< Where is the dialin node */
+ char serv_sysadm[64]; /**< Who's to blame on trouble */
+ char serv_moreprompt[SIZ]; /**< Whats the commandline textprompt */
+ int serv_ok_floors; /**< what??? */
+ int serv_supports_ldap; /**< is the server linked against an ldap tree for adresses? */
};
-/*
- * This struct holds a list of rooms for <G>oto operations.
+/**
+ * \brief This struct holds a list of rooms for \\\<G\\\>oto operations.
*/
struct march {
- struct march *next;
- char march_name[128];
- int march_floor;
- int march_order;
+ struct march *next; /**< pointer to next in linked list */
+ char march_name[128]; /**< function name ??? */
+ int march_floor; /**< floor number */
+ int march_order; /**< order number???*/
};
-/*
- * This struct holds a list of rooms for client display.
- * (oooh, a tree!)
+/* *
+ * \brief This struct holds a list of rooms for client display.
+ * (oooh, a tree!) (double linked list? )
*/
struct roomlisting {
- struct roomlisting *lnext;
- struct roomlisting *rnext;
- char rlname[128];
- unsigned rlflags;
- int rlfloor;
- int rlorder;
+ struct roomlisting *lnext;/**< pointer to the next roomlisting */
+ struct roomlisting *rnext;/**< pointer to the previous roomlisting */
+ char rlname[128]; /**< the userprintable roomname */
+ unsigned rlflags; /**< the room flags */
+ int rlfloor; /**< the floor it reside on (citadel server room number???)*/
+ int rlorder; /**< the order to print it???*/
};
-/*
- * Dynamic content for variable substitution in templates
+/**
+ * \brief Dynamic content for variable substitution in templates
*/
struct wcsubst {
- struct wcsubst *next;
- int wcs_type;
- char wcs_key[32];
- void *wcs_value;
- void (*wcs_function)(void);
+ struct wcsubst *next; /**< next item in the list */
+ int wcs_type; /**< which type of ??? */
+ char wcs_key[32]; /**< ??? what?*/
+ void *wcs_value; /**< ???? what?*/
+ void (*wcs_function)(void); /**< funcion hook ???*/
};
-/*
- * Values for wcs_type
+/**
+ * \brief Values for wcs_type
*/
enum {
- WCS_STRING,
- WCS_FUNCTION,
- WCS_SERVCMD
+ WCS_STRING, /**< its a string */
+ WCS_FUNCTION, /**< its a function callback */
+ WCS_SERVCMD /**< its a command to send to the citadel server */
};
-
+/**
+ * \brief mail attachment ???
+ */
struct wc_attachment {
- struct wc_attachment *next;
- size_t length;
- char content_type[SIZ];
- char filename[SIZ];
- char *data;
+ struct wc_attachment *next;/**< pointer to next in list */
+ size_t length; /**< length of the contenttype */
+ char content_type[SIZ]; /**< the content itself ???*/
+ char filename[SIZ]; /**< the filename hooked to this content ??? */
+ char *data; /**< the data pool; aka this content */
};
+/**
+ * \brief message summary structure. ???
+ */
struct message_summary {
- time_t date;
- long msgnum;
- char from[128];
- char to[128];
- char subj[128];
- int hasattachments;
- int is_new;
+ time_t date; /**< its creation date */
+ long msgnum; /**< the message number on the citadel server */
+ char from[128]; /**< the author */
+ char to[128]; /**< the recipient */
+ char subj[128]; /**< the title / subject */
+ int hasattachments; /**< does it have atachments? */
+ int is_new; /**< is it yet read? */
};
-/* Data structure for roomlist-to-folderlist conversion */
+/**
+ * \brief Data structure for roomlist-to-folderlist conversion
+ */
struct folder {
- int floor;
- char room[SIZ];
- char name[SIZ];
- int hasnewmsgs;
- int is_mailbox;
- int selectable;
- int view;
+ int floor; /**< which floor is it on */
+ char room[SIZ]; /**< which roomname ??? */
+ char name[SIZ]; /**< which is its own name??? */
+ int hasnewmsgs; /**< are there unread messages inside */
+ int is_mailbox; /**< is it a mailbox? */
+ int selectable; /**< can we select it ??? */
+ int view; /**< whats its default view? inbox/calendar.... */
};
-/*
- * One of these is kept for each active Citadel session.
- * HTTP transactions are bound to one at a time.
+/**
+ * \brief One of these is kept for each active Citadel session.
+ * HTTP transactions are bound to on e at a time.
*/
struct wcsession {
- struct wcsession *next; /* Linked list */
- int wc_session; /* WebCit session ID */
- char wc_username[128];
- char wc_fullname[128];
- char wc_password[128];
- char wc_roomname[256];
- int connected;
- int logged_in;
- int axlevel;
- int is_aide;
- int is_room_aide;
- int http_sock;
- int serv_sock;
- int chat_sock;
- unsigned room_flags;
- int wc_view;
- int wc_default_view;
- int wc_is_trash;
- int wc_floor;
- char ugname[128];
- long uglsn;
- int upload_length;
- char *upload;
- char upload_filename[PATH_MAX];
- char upload_content_type[256];
- int new_mail;
- int remember_new_mail;
- int need_regi; /* This user needs to register. */
- int need_vali; /* New users require validation. */
- char cs_inet_email[256]; /* User's preferred Internet addr. */
- pthread_mutex_t SessionMutex; /* mutex for exclusive access */
- time_t lastreq; /* Timestamp of most recent HTTP */
- int killthis; /* Nonzero == purge this session */
- struct march *march; /* march mode room list */
- char reply_to[512]; /* reply-to address */
- long msgarr[10000]; /* for read operations */
- int num_summ;
- struct message_summary *summ;
- int is_wap; /* Client is a WAP gateway */
- struct urlcontent *urlstrings;
- struct wcsubst *vars;
- char this_page[512]; /* address of current page */
- char http_host[512]; /* HTTP Host: header */
- char *preferences;
-#ifdef WEBCIT_WITH_CALENDAR_SERVICE
- struct disp_cal {
- icalcomponent *cal; /* cal items for display */
- long cal_msgnum; /* cal msgids for display */
- } *disp_cal;
- int num_cal;
-#endif
- struct wc_attachment *first_attachment;
- char ImportantMessage[SIZ];
- char last_chat_user[256];
- int ctdl_pid; /* Session ID on the Citadel server */
- char httpauth_user[256]; /* only for GroupDAV sessions */
- char httpauth_pass[256]; /* only for GroupDAV sessions */
- size_t burst_len;
- char *burst;
- int gzip_ok; /* Nonzero if Accept-encoding: gzip */
- int is_mailbox; /* the current room is a private mailbox */
- struct folder *cache_fold; /* cache the iconbar room list */
- int cache_max_folders;
- int cache_num_floors;
- time_t cache_timestamp;
- int current_iconbar; /* What's currently in the iconbar? */
- char floordiv_expanded[32]; /* which floordiv currently expanded */
- int selected_language; /* Language selected by user */
- time_t last_pager_check; /* last time we polled for instant msgs */
+ struct wcsession *next; /**< Linked list */
+ int wc_session; /**< WebCit session ID */
+ char wc_username[128]; /**< ??? todo */
+ char wc_fullname[128]; /**< ??? todo */
+ char wc_password[128]; /**< ??? todo */
+ char wc_roomname[256]; /**< ??? todo */
+ int connected; /**< ??? todo */
+ int logged_in; /**< ??? todo */
+ int axlevel; /**< ??? todo */
+ int is_aide; /**< ??? todo */
+ int is_room_aide; /**< ??? todo */
+ int http_sock; /**< ??? todo */
+ int serv_sock; /**< ??? todo */
+ int chat_sock; /**< ??? todo */
+ unsigned room_flags; /**< ??? todo */
+ int wc_view; /**< ??? todo */
+ int wc_default_view; /**< ??? todo */
+ int wc_is_trash; /**< ??? todo */
+ int wc_floor; /**< ??? todo */
+ char ugname[128]; /**< ??? todo */
+ long uglsn; /**< ??? todo */
+ int upload_length; /**< ??? todo */
+ char *upload; /**< ??? todo */
+ char upload_filename[PATH_MAX]; /**< ??? todo */
+ char upload_content_type[256]; /**< ??? todo */
+ int new_mail; /**< ??? todo */
+ int remember_new_mail; /**< ??? todo */
+ int need_regi; /**< This user needs to register. */
+ int need_vali; /**< New users require validation. */
+ char cs_inet_email[256]; /**< User's preferred Internet addr. */
+ pthread_mutex_t SessionMutex; /**< mutex for exclusive access */
+ time_t lastreq; /**< Timestamp of most recent HTTP */
+ int killthis; /**< Nonzero == purge this session */
+ struct march *march; /**< march mode room list */
+ char reply_to[512]; /**< reply-to address */
+ long msgarr[10000]; /**< for read operations */
+ int num_summ; /**< ??? todo */
+ struct message_summary *summ; /**< ??? todo */
+ int is_wap; /**< Client is a WAP gateway */
+ struct urlcontent *urlstrings; /**< ??? todo */
+ struct wcsubst *vars; /**< ??? todo*/
+ char this_page[512]; /**< address of current page */
+ char http_host[512]; /**< HTTP Host: header */
+ char *preferences; /**< ??? todo */
+#ifdef WEBCIT_WITH_CALENDAR_SERVICE
+ /** \brief ical???? */
+ struct disp_cal {
+ icalcomponent *cal; /**< cal items for display */
+ long cal_msgnum; /**< cal msgids for display */
+ } *disp_cal;
+ int num_cal; /**< ??? todo */
+#endif
+ struct wc_attachment *first_attachment; /**< ??? todo */
+ char ImportantMessage[SIZ]; /**< ??? todo */
+ int ctdl_pid; /**< Session ID on the Citadel server */
+ char httpauth_user[256]; /**< only for GroupDAV sessions */
+ char httpauth_pass[256]; /**< only for GroupDAV sessions */
+ size_t burst_len; /**< ??? todo */
+ char *burst; /**< ??? todo */
+ int gzip_ok; /**< Nonzero if Accept-encoding: gzip */
+ int is_mailbox; /**< the current room is a private mailbox */
+ struct folder *cache_fold; /**< cache the iconbar room list */
+ int cache_max_folders; /**< ??? todo */
+ int cache_num_floors; /**< ??? todo */
+ time_t cache_timestamp; /**< ??? todo */
+ int current_iconbar; /**< What's currently in the iconbar? */
+ char floordiv_expanded[32]; /**< which floordiv currently expanded */
+ int selected_language; /**< Language selected by user */
+ time_t last_pager_check; /**< last time we polled for instant msgs */
};
-/* values for WC->current_iconbar */
+/** values for WC->current_iconbar */
enum {
- current_iconbar_menu,
- current_iconbar_roomlist
+ current_iconbar_menu, /**< view the icon menue */
+ current_iconbar_roomlist /**< view the roomtree */
};
-#define num_parms(source) num_tokens(source, '|')
+#define num_parms(source) num_tokens(source, '|')
/* Per-session data */
#define WC ((struct wcsession *)pthread_getspecific(MyConKey))
/*
* $Id$
- *
- * This contains a simple multithreaded TCP server manager. It sits around
+ */
+/**
+ * \defgroup Webserver This contains a simple multithreaded TCP server manager. It sits around
* waiting on the specified port for incoming HTTP connections. When a
* connection is established, it calls context_loop() from context_loop.c.
*
*/
-
-#include "webcit.h"
+/*@{*/
#include "webserver.h"
#ifndef HAVE_SNPRINTF
int vsnprintf(char *buf, size_t max, const char *fmt, va_list argp);
#endif
-int verbosity = 9; /* Logging level */
-int msock; /* master listening socket */
-int is_https = 0; /* Nonzero if I am an HTTPS service */
-int follow_xff = 0; /* Follow X-Forwarded-For: header */
+int verbosity = 9; /**< Logging level */
+int msock; /**< master listening socket */
+int is_https = 0; /**< Nonzero if I am an HTTPS service */
+int follow_xff = 0; /**< Follow X-Forwarded-For: header */
extern void *context_loop(int);
extern void *housekeeping_loop(void);
extern pthread_mutex_t SessionListMutex;
extern pthread_key_t MyConKey;
-char *server_cookie = NULL;
+char *server_cookie = NULL; /**< our Cookie connection to the client */
-char *ctdlhost = DEFAULT_HOST;
-char *ctdlport = DEFAULT_PORT;
-int setup_wizard = 0;
-char wizard_filename[PATH_MAX];
+char *ctdlhost = DEFAULT_HOST; /**< our name */
+char *ctdlport = DEFAULT_PORT; /**< our Port */
+int setup_wizard = 0; /**< should we run the setup wizard? \todo */
+char wizard_filename[PATH_MAX];/**< where's the setup wizard? */
-/*
- * This is a generic function to set up a master socket for listening on
+/**
+ * \brief This is a generic function to set up a master socket for listening on
* a TCP port. The server shuts down if the bind fails.
+ * \param ip_addr ip to bind to
+ * \param port_number the port to bind to
+ * \param queue_len the size of the input queue ????
*/
int ig_tcp_server(char *ip_addr, int port_number, int queue_len)
{
lprintf(1, "Can't create a socket: %s\n", strerror(errno));
exit(errno);
}
- /* Set some socket options that make sense. */
+ /** Set some socket options that make sense. */
i = 1;
setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &i, sizeof(i));
-/*
- * Create a Unix domain socket and listen on it
+/**
+ * \brief Create a Unix domain socket and listen on it
+ * \param sockpath file name of the unix domain socket
+ * \param queue_len queue size of the kernel fifo????
*/
int ig_uds_server(char *sockpath, int queue_len)
{
-/*
- * Read data from the client socket.
- * Return values are:
- * 1 Requested number of bytes has been read.
- * 0 Request timed out.
- * -1 Connection is broken, or other error.
+/**
+ * \brief Read data from the client socket.
+ * \param sock socket fd to read from ???
+ * \param buf buffer to read into
+ * \param bytes how large is the read buffer?
+ * \param timeout how long should we wait for input?
+ * \return values are\
+ * 1 Requested number of bytes has been read.\
+ * 0 Request timed out.\
+ * -1 Connection is broken, or other error.
*/
int client_read_to(int sock, char *buf, int bytes, int timeout)
{
return (1);
}
-
+/**
+ * \brief write data to the client
+ * \param buf data to write to the client
+ * \param count size of buffer
+ */
ssize_t client_write(const void *buf, size_t count)
{
return (write(WC->http_sock, buf, count));
}
-
+/**
+ * \brief what burst???
+ */
void begin_burst(void)
{
if (WC->burst != NULL) {
}
-/*
- * compress_gzip() uses the same calling syntax as compress2(), but it
+/**
+ * \brief uses the same calling syntax as compress2(), but it
* creates a stream compatible with HTTP "Content-encoding: gzip"
*/
#ifdef HAVE_ZLIB
-#define DEF_MEM_LEVEL 8
-#define OS_CODE 0x03 /* unix */
-int ZEXPORT compress_gzip(Bytef * dest, uLongf * destLen,
- const Bytef * source, uLong sourceLen, int level)
+#define DEF_MEM_LEVEL 8 /**< memlevel??? */
+#define OS_CODE 0x03 /**< unix */
+int ZEXPORT compress_gzip(Bytef * dest, /**< compressed buffer*/
+ uLongf * destLen, /**< length of the compresed data */
+ const Bytef * source, /**< source to encode */
+ uLong sourceLen, /**< length of the source to encode */
+ int level) /**< what level??? */
{
- const int gz_magic[2] = { 0x1f, 0x8b }; /* gzip magic header */
+ const int gz_magic[2] = { 0x1f, 0x8b }; /** gzip magic header */
- /* write gzip header */
+ /** write gzip header */
sprintf((char *) dest, "%c%c%c%c%c%c%c%c%c%c",
gz_magic[0], gz_magic[1], Z_DEFLATED,
- 0 /*flags */ , 0, 0, 0, 0 /*time */ , 0 /*xflags */ ,
+ 0 /*flags */ , 0, 0, 0, 0 /*time */ , 0 /** xflags */ ,
OS_CODE);
/* normal deflate */
}
#endif
+/**
+ * \brief what burst???
+ */
void end_burst(void)
{
size_t the_len;
-/*
- * Read data from the client socket with default timeout.
+/**
+ * \brief Read data from the client socket with default timeout.
* (This is implemented in terms of client_read_to() and could be
* justifiably moved out of sysdep.c)
+ * \param sock the socket fd to read from???
+ * \param buf the buffer to write to
+ * \param bytes how large is the buffer
*/
int client_read(int sock, char *buf, int bytes)
{
}
-/*
- * client_getln() ... Get a LF-terminated line of text from the client.
+/**
+ * \brief Get a LF-terminated line of text from the client.
* (This is implemented in terms of client_read() and could be
* justifiably moved out of sysdep.c)
+ * \param sock socket fd to get client line from???
+ * \param buf buffer to write read data to
+ * \param bufsiz how many bytes to read
+ * \return numer of bytes read???
*/
int client_getln(int sock, char *buf, int bufsiz)
{
int i, retval;
- /* Read one character at a time.
- */
+ /** Read one character at a time.*/
for (i = 0;; i++) {
retval = client_read(sock, &buf[i], 1);
if (retval != 1 || buf[i] == '\n' || i == (bufsiz-1))
break;
}
- /* If we got a long line, discard characters until the newline.
- */
+ /** If we got a long line, discard characters until the newline. */
if (i == (bufsiz-1))
while (buf[i] != '\n' && retval == 1)
retval = client_read(sock, &buf[i], 1);
- /*
+ /**
* Strip any trailing non-printable characters.
*/
buf[i] = 0;
}
-/*
- * Start running as a daemon. Only close stdio if do_close_stdio is set.
+/**
+ * \brief Start running as a daemon.
+ * param do_close_stdio Only close stdio if set.
*/
void start_daemon(int do_close_stdio)
{
void spawn_another_worker_thread()
{
- pthread_t SessThread; /* Thread descriptor */
- pthread_attr_t attr; /* Thread attributes */
+ pthread_t SessThread; /**< Thread descriptor */
+ pthread_attr_t attr; /**< Thread attributes */
int ret;
lprintf(3, "Creating a new thread\n");
- /* set attributes for the new thread */
+ /** set attributes for the new thread */
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
- /* Our per-thread stacks need to be bigger than the default size, otherwise
+ /**
+ * Our per-thread stacks need to be bigger than the default size, otherwise
* the MIME parser crashes on FreeBSD, and the IMAP service crashes on
* 64-bit Linux.
*/
pthread_attr_destroy(&attr);
}
- /* now create the thread */
+ /** now create the thread */
if (pthread_create(&SessThread, &attr,
(void *(*)(void *)) worker_entry, NULL)
!= 0) {
lprintf(1, "Can't create thread: %s\n", strerror(errno));
}
- /* free up the attributes */
+ /** free up the attributes */
pthread_attr_destroy(&attr);
}
-/*
- * Here's where it all begins.
+/**
+ * \brief Here's where it all begins.
+ * \param argc number of commandline args
+ * \param argv the commandline arguments
*/
int main(int argc, char **argv)
{
- pthread_t SessThread; /* Thread descriptor */
- pthread_attr_t attr; /* Thread attributes */
- int a, i; /* General-purpose variables */
- int port = PORT_NUM; /* Port to listen on */
+ pthread_t SessThread; /**< Thread descriptor */
+ pthread_attr_t attr; /**< Thread attributes */
+ int a, i; /**< General-purpose variables */
+ int port = PORT_NUM; /**< Port to listen on */
char tracefile[PATH_MAX];
char ip_addr[256];
char *webcitdir = WEBCITDIR;
char *locale = NULL;
char *mo = NULL;
#endif /* ENABLE_NLS */
- char uds_listen_path[PATH_MAX]; /* listen on a unix domain socket? */
+ char uds_listen_path[PATH_MAX]; /**< listen on a unix domain socket? */
strcpy(uds_listen_path, "");
- /* Parse command line */
+ /** Parse command line */
#ifdef HAVE_OPENSSL
while ((a = getopt(argc, argv, "h:i:p:t:x:cfs")) != EOF)
#else
if (++optind < argc)
ctdlport = argv[optind];
}
- /* Tell 'em who's in da house */
+ /** Tell 'em who's in da house */
lprintf(1, SERVER "\n");
lprintf(1, "Copyright (C) 1996-2005 by the Citadel development team.\n"
"This software is distributed under the terms of the "
perror("chdir");
}
- /* initialize the International Bright Young Thing */
+ /** initialize the International Bright Young Thing */
#ifdef ENABLE_NLS
initialize_locales();
initialize_viewdefs();
initialize_axdefs();
- /*
+ /**
* Set up a place to put thread-specific data.
* We only need a single pointer per thread - it points to the
* wcsession struct to which the thread is currently bound.
lprintf(1, "Can't create TSD key: %s\n", strerror(errno));
}
- /*
+ /**
* Set up a place to put thread-specific SSL data.
* We don't stick this in the wcsession struct because SSL starts
* up before the session is bound, and it gets torn down between
}
#endif
- /*
+ /**
* Bind the server to our favorite port.
* There is no need to check for errors, because ig_tcp_server()
* exits if it doesn't succeed.
pthread_mutex_init(&SessionListMutex, NULL);
- /*
+ /**
* Start up the housekeeping thread
*/
pthread_attr_init(&attr);
(void *(*)(void *)) housekeeping_loop, NULL);
- /*
+ /**
* If this is an HTTPS server, fire up SSL
*/
#ifdef HAVE_OPENSSL
}
#endif
- /* Start a few initial worker threads */
+ /** Start a few initial worker threads */
for (i = 0; i < (MIN_WORKER_THREADS); ++i) {
spawn_another_worker_thread();
}
}
-/*
+/**
* Entry point for worker threads
*/
void worker_entry(void)
int fail_this_transaction = 0;
do {
- /* Only one thread can accept at a time */
+ /** Only one thread can accept at a time */
fail_this_transaction = 0;
ssock = accept(msock, NULL, 0);
if (ssock < 0) {
lprintf(2, "accept() failed: %s\n",
strerror(errno));
} else {
- /* Set the SO_REUSEADDR socket option */
+ /** Set the SO_REUSEADDR socket option */
i = 1;
setsockopt(ssock, SOL_SOCKET, SO_REUSEADDR,
&i, sizeof(i));
- /* If we are an HTTPS server, go crypto now. */
+ /** If we are an HTTPS server, go crypto now. */
#ifdef HAVE_OPENSSL
if (is_https) {
if (starttls(ssock) != 0) {
#endif
if (fail_this_transaction == 0) {
- /* Perform an HTTP transaction... */
+ /** Perform an HTTP transaction... */
context_loop(ssock);
- /* ...and close the socket. */
+ /** ...and close the socket. */
lingering_close(ssock);
}
pthread_exit(NULL);
}
-
+/**
+ * \brief logprintf. log messages
+ * logs to stderr if loglevel is lower than the verbosity set at startup
+ * \param loglevel level of the message
+ * \param format the printf like format string
+ * \param ... the strings to put into format
+ */
int lprintf(int loglevel, const char *format, ...)
{
va_list ap;
}
return 1;
}
+
+
+/*@}*/
/*
* $Id$
- *
- * Display a list of all users currently logged on to the Citadel server.
*/
-
+/**
+ * \defgroup DislpayWho Display a list of all users currently logged on to the Citadel server.
+ */
+/*@{*/
#include "webcit.h"
-/*
- * Display inner div of Wholist
+/**
+ * \brief Display inner div of Wholist
*/
void who_inner_div(void) {
char buf[SIZ], user[SIZ], room[SIZ], host[SIZ],
}
wprintf("</td>");
- /* (link to page this user) */
+ /** (link to page this user) */
wprintf("<td><a href=\"display_page?recp=");
urlescputs(user);
wprintf("\">"
" border=\"0\" /></a> ");
wprintf("</td>");
- /* (idle flag) */
+ /** (idle flag) */
wprintf("<td>");
if ((now - last_activity) > 900L) {
wprintf(" "
- /* username (link to user bio/photo page) */
+ /** username (link to user bio/photo page) */
wprintf("<a href=\"showuser?who=");
urlescputs(user);
wprintf("\">");
escputs(user);
wprintf("</a>");
- /* room */
+ /** room */
wprintf("</td>\n\t<td>");
escputs(room);
if (strlen(realroom) > 0) {
}
wprintf("</td>\n\t<td>");
- /* hostname */
+ /** hostname */
escputs(host);
if (strlen(realhost) > 0) {
wprintf("<br /><i>");
}
-/*
- * who is on?
+/**
+ * \brief who is on?
*/
void who(void)
{
);
wprintf("</div>\n");
- /* JavaScript to make the ajax refresh happen:
+ /**
+ * JavaScript to make the ajax refresh happen:
* See http://www.sergiopereira.com/articles/prototype.js.html for info on Ajax.PeriodicalUpdater
* It wants: 1. The div being updated
* 2. The URL of the update source
wDumpContent(1);
}
-
+/**
+ * \brief end session \todo what??? does this belong here?
+ */
void terminate_session(void)
{
char buf[SIZ];
}
-/*
- * Change your session info (fake roomname and hostname)
+/**
+ * \brief Change your session info (fake roomname and hostname)
*/
void edit_me(void)
{
wDumpContent(1);
}
}
+
+
+/*@}*/