Done with doxygenizing
authorWilfried Göesgens <willi@citadel.org>
Mon, 23 Jan 2006 13:35:50 +0000 (13:35 +0000)
committerWilfried Göesgens <willi@citadel.org>
Mon, 23 Jan 2006 13:35:50 +0000 (13:35 +0000)
25 files changed:
webcit/Doxyfile
webcit/netconf.c
webcit/notes.c
webcit/paging.c
webcit/preferences.c
webcit/roomops.c
webcit/rss.c
webcit/serv_func.c
webcit/siteconfig.c
webcit/snprintf.c
webcit/subst.c
webcit/summary.c
webcit/sysmsgs.c
webcit/tabs.c
webcit/tcp_sockets.c
webcit/tools.c
webcit/useredit.c
webcit/userlist.c
webcit/vcard.c
webcit/vcard.h
webcit/vcard_edit.c
webcit/webcit.c
webcit/webcit.h
webcit/webserver.c
webcit/who.c

index 7c1a3f92f408bd79189aeb7f68c25ff4746382eb..65f044bb0d9dbacc32feeed370511e8b194fb10b 100644 (file)
@@ -480,8 +480,7 @@ RECURSIVE              = NO
 # 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 
@@ -1007,7 +1006,7 @@ INCLUDE_FILE_PATTERNS  =
 # 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 
@@ -1117,7 +1116,7 @@ GROUP_GRAPHS           = YES
 # 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.
index eb4d8f2d781007831fd1b1610d722c48b51f3410..87cdda642b45f653455f351d1d32f682931a9ab8 100644 (file)
@@ -1,12 +1,16 @@
 /* 
  * $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];
@@ -51,7 +55,9 @@ void edit_node(void) {
 }
 
 
-
+/**
+ * \brief add a node
+ */
 void display_add_node(void)
 {
        output_headers(1, 1, 2, 0, 0, 0);
@@ -82,6 +88,9 @@ void display_add_node(void)
        wDumpContent(1);
 }
 
+/**
+ * \brief modify an existing node
+ */
 void display_edit_node(void)
 {
        char buf[512];
@@ -143,7 +152,7 @@ void display_edit_node(void)
                }
        }
 
-       else {          /* command error getting configuration */
+       else {          /** command error getting configuration */
                wprintf("%s<br />\n", &buf[4]);
        }
 
@@ -151,7 +160,9 @@ void display_edit_node(void)
 }
 
 
-
+/**
+ * \brief display all configured nodes
+ */
 void display_netconf(void)
 {
        char buf[SIZ];
@@ -203,7 +214,9 @@ void display_netconf(void)
        wDumpContent(1);
 }
 
-
+/**
+ * \brief display the dialog to verify the deletion
+ */
 void display_confirm_delete_node(void)
 {
        char node[SIZ];
@@ -234,7 +247,9 @@ void display_confirm_delete_node(void)
        wDumpContent(1);
 }
 
-
+/**
+ * \brief actually delete the node
+ */
 void delete_node(void)
 {
        char buf[SIZ];
@@ -272,7 +287,9 @@ void delete_node(void)
        display_netconf();
 }
 
-
+/**
+ * \brief add a new node
+ */
 void add_node(void)
 {
        char node[SIZ];
@@ -299,3 +316,4 @@ void add_node(void)
 }
 
 
+/*@}*/
index 51cdc8960f7d9685dc57b170cf9d22ba42f92052..89f2c84ca31a342c04f0d09211e8d840b6a0c4d1 100644 (file)
@@ -1,13 +1,18 @@
 /*
  * $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];
@@ -27,7 +32,7 @@ void display_note(long msgnum) {
        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);
                }
@@ -37,13 +42,16 @@ void display_note(long msgnum) {
                }
        }
 
-       /* 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(&notetext[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);
 }
+
+
+/*@}*/
index ddc2fbbeaf1087422b7dbb255e2d15ce4f9bba01..097b6b74ba6b68caccb2508610b3c7f8e2dc81cb 100644 (file)
@@ -1,13 +1,14 @@
 /*
  * $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)
 {
@@ -60,8 +61,8 @@ void display_page(void)
        wDumpContent(1);
 }
 
-/*
- * page another user
+/**
+ * \brief page another user
  */
 void page_user(void)
 {
@@ -114,14 +115,14 @@ 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') {
@@ -129,7 +130,8 @@ void do_chat(void)
                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) {
@@ -137,7 +139,8 @@ void do_chat(void)
                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.)
         */
@@ -148,7 +151,8 @@ void do_chat(void)
 }
 
 
-/*
+/**
+ * \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.
  */
@@ -156,7 +160,7 @@ void page_popup(void)
 {
        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] == '*') {
@@ -169,7 +173,7 @@ void page_popup(void)
                }
        }
 
-       /* 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"
@@ -189,8 +193,9 @@ void page_popup(void)
 
 
 
-/*
- * 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) {
@@ -201,12 +206,12 @@ 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);
                }
 
@@ -214,7 +219,7 @@ int setup_chat_socket(void) {
                        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;
@@ -240,7 +245,7 @@ int setup_chat_socket(void) {
                        }
                }
 
-               /* Unswap the sockets. */
+               /** Unswap the sockets. */
                i = WC->serv_sock;
                WC->serv_sock = WC->chat_sock;
                WC->chat_sock = i;
@@ -253,8 +258,9 @@ int setup_chat_socket(void) {
 
 
 
-/*
- * 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.
  */
@@ -287,7 +293,7 @@ void chat_recv(void) {
                return;
        }
 
-       /*
+       /**
         * See if there is any chat data waiting.
         */
        output_data = strdup("");
@@ -299,7 +305,7 @@ void chat_recv(void) {
                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;
@@ -312,12 +318,12 @@ void chat_recv(void) {
                                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");
@@ -337,7 +343,7 @@ void chat_recv(void) {
                        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"
                );
@@ -408,8 +414,8 @@ void chat_recv(void) {
 }
 
 
-/*
- * sending side of the chat window
+/**
+ * \brief sending side of the chat window
  */
 void chat_send(void) {
        int i;
@@ -449,7 +455,7 @@ void chat_send(void) {
                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;
@@ -470,7 +476,7 @@ void chat_send(void) {
                }
        }
 
-       /* Unswap the sockets. */
+       /** Unswap the sockets. */
        i = WC->serv_sock;
        WC->serv_sock = WC->chat_sock;
        WC->chat_sock = i;
@@ -489,3 +495,4 @@ void chat_send(void) {
        wDumpContent(0);
 }
 
+/*@}*/
index 9414a1edaac4561989218cedcbaec55c4d2e6f21..b76b460a96cf5de4637e720d84a07add41283f50 100644 (file)
@@ -1,16 +1,19 @@
 /*
  * $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;
@@ -56,14 +59,14 @@ void load_preferences(void) {
                }
        }
 
-       /* 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];
@@ -80,7 +83,9 @@ int goto_config_room(void) {
        return(0);
 }
 
-
+/**
+ * \brief save the modifications
+ */
 void save_preferences(void) {
        char buf[SIZ];
        long msgnum = 0L;
@@ -109,11 +114,17 @@ void save_preferences(void) {
                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;
@@ -132,6 +143,12 @@ void get_preference(char *key, char *value, size_t value_len) {
        }
 }
 
+/**
+ * \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;
@@ -168,8 +185,8 @@ void set_preference(char *key, char *value, int save_to_server) {
 
 
 
-/* 
- * display form for changing your preferences and settings
+/** 
+ * \brief display form for changing your preferences and settings
  */
 void display_preferences(void)
 {
@@ -193,13 +210,13 @@ 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);
@@ -221,7 +238,7 @@ void display_preferences(void)
 
        wprintf("</td></tr>\n");
 
-       /*
+       /**
         * Calendar hour format
         */
        get_preference("calhourformat", calhourformat, sizeof calhourformat);
@@ -244,7 +261,7 @@ void display_preferences(void)
 
        wprintf("</td></tr>\n");
 
-       /*
+       /**
         * Calendar day view -- day start time
         */
        get_preference("daystart", buf, sizeof buf);
@@ -273,7 +290,7 @@ void display_preferences(void)
        wprintf("</SELECT>\n");
        wprintf("</td></tr>\n");
 
-       /*
+       /**
         * Calendar day view -- day end time
         */
        get_preference("dayend", buf, sizeof buf);
@@ -302,7 +319,7 @@ void display_preferences(void)
        wprintf("</SELECT>\n");
        wprintf("</td></tr>\n");
 
-       /*
+       /**
         * Signature
         */
        get_preference("use_sig", buf, sizeof buf);
@@ -363,15 +380,15 @@ void display_preferences(void)
 
        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)
 {
@@ -385,7 +402,8 @@ 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);
@@ -399,3 +417,6 @@ void set_preferences(void)
 
        display_main_menu();
 }
+
+
+/*@}*/
index 9573fc9b3860bc681a5593b38d2fd35fbb0fc88f..aa38db4db7fb0fe0f9aef0f1dcde84b3fe27a30d 100644 (file)
@@ -1,15 +1,19 @@
 /*
  * $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");
@@ -21,8 +25,8 @@ void initialize_viewdefs(void) {
 }
 
 
-/*
- * load the list of floors
+/**
+ * \brief load the list of floors
  */
 void load_floorlist(void)
 {
@@ -44,8 +48,8 @@ void load_floorlist(void)
 }
 
 
-/*
- * remove a room from the march list
+/**
+ * \brief remove a room from the march list
  */
 void remove_march(char *aaa)
 {
@@ -75,7 +79,10 @@ 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];
@@ -110,8 +117,11 @@ void room_tree_list(struct roomlisting *rp)
 }
 
 
-/* 
- * 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)
 {
@@ -133,8 +143,9 @@ 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)
 {
@@ -146,7 +157,7 @@ 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') {
@@ -188,15 +199,16 @@ void listrms(char *variety)
 
        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("&nbsp;");
 }
 
 
-/*
- * list all forgotten rooms
+/**
+ * \brief list all forgotten rooms
  */
 void zapped_list(void)
 {
@@ -214,8 +226,8 @@ 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)
 {
@@ -234,7 +246,9 @@ 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.
@@ -292,8 +306,8 @@ void embed_room_graphic(void) {
 
 
 
-/*
- * 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;
@@ -309,7 +323,7 @@ void embed_view_o_matic(void) {
                "[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.
@@ -332,11 +346,16 @@ void embed_view_o_matic(void) {
 }
 
 
-
+/**
+ * \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) {
@@ -345,21 +364,22 @@ void embed_room_banner(char *got, int navbar_style) {
                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);
 
@@ -563,8 +583,9 @@ void embed_room_banner(char *got, int navbar_style) {
 
 
 
-/*
- * 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)
@@ -573,11 +594,11 @@ 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') {
@@ -616,9 +637,12 @@ int gotoroom(char *gname)
 }
 
 
-/*
- * 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)
 {
@@ -655,7 +679,8 @@ 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.
@@ -668,7 +693,8 @@ void gotonext(void)
        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.
         */
 
@@ -691,9 +717,10 @@ void gotonext(void)
                                        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_");
@@ -705,10 +732,10 @@ void gotonext(void)
                                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) {
@@ -722,6 +749,10 @@ void gotonext(void)
 }
 
 
+/**
+ * \brief goto next room
+ * \param next_room next room to go to
+ */
 void smart_goto(char *next_room) {
        gotoroom(next_room);
        readloop("readnew");
@@ -729,8 +760,8 @@ void smart_goto(char *next_room) {
 
 
 
-/*
- * 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)
 {
@@ -746,8 +777,8 @@ void slrp_highest(void)
 }
 
 
-/*
- * un-goto the previous room
+/**
+ * \brief un-goto the previous room
  */
 void ungoto(void)
 {
@@ -776,11 +807,11 @@ 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) {
@@ -838,8 +869,8 @@ int self_service(int newval) {
 
 
 
-/*
- * display the form for editing a room
+/**
+ * \brief display the form for editing a room
  */
 void display_editroom(void)
 {
@@ -883,7 +914,7 @@ 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%%>"
@@ -987,9 +1018,9 @@ void display_editroom(void)
        wprintf("<TD>&nbsp;</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");
@@ -1088,7 +1119,7 @@ void display_editroom(void)
                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 ");
@@ -1119,7 +1150,7 @@ void display_editroom(void)
                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)
@@ -1133,7 +1164,7 @@ void display_editroom(void)
                wprintf("> ");
                wprintf(_("Permanent (does not auto-purge)"));
 
-       /* start of anon options */
+               /** start of anon options */
        
                wprintf("\n<LI>");
                wprintf(_("Anonymous messages"));
@@ -1184,13 +1215,13 @@ void display_editroom(void)
        }
 
 
-       /* 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")) {
@@ -1230,7 +1261,7 @@ void display_editroom(void)
                        }
                }
 
-               /* Display the stuff */
+               /** Display the stuff */
                wprintf("<CENTER><br />"
                        "<TABLE border=1 cellpadding=5><TR>"
                        "<TD><B><I>");
@@ -1339,7 +1370,7 @@ void display_editroom(void)
 
        }
 
-       /* Mailing list management */
+       /** Mailing list management */
        if (!strcmp(tab, "listserv")) {
 
                wprintf("<br /><center>"
@@ -1431,7 +1462,7 @@ void display_editroom(void)
        }
 
 
-       /* Mailing list management */
+       /** Mailing list management */
        if (!strcmp(tab, "expire")) {
 
                serv_puts("GPEX room");
@@ -1517,20 +1548,20 @@ void display_editroom(void)
 
        }
 
-       /* 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;
@@ -1542,8 +1573,8 @@ void toggle_self_service(void) {
 
 
 
-/*
- * save new parameters for a room
+/**
+ * \brief save new parameters for a room
  */
 void editroom(void)
 {
@@ -1704,8 +1735,8 @@ 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];
@@ -1754,8 +1785,8 @@ void do_invt_kick(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 display_whok(void)
 {
@@ -1815,8 +1846,8 @@ 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)
 {
@@ -1864,13 +1895,14 @@ 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) ) {        "
@@ -1952,8 +1984,8 @@ void display_entroom(void)
 
 
 
-/*
- * support function for entroom() -- sets the default view 
+/**
+ * \brief support function for entroom() -- sets the default view 
  */
 void er_set_default_view(int newview) {
 
@@ -1988,8 +2020,8 @@ void er_set_default_view(int newview) {
 
 
 
-/*
- * enter a new room
+/**
+ * \brief enter a new room
  */
 void entroom(void)
 {
@@ -2037,8 +2069,8 @@ 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)
 {
@@ -2093,8 +2125,8 @@ void display_private(char *rname, int req_pass)
        wDumpContent(1);
 }
 
-/* 
- * goto a private room
+/**
+ * \brief goto a private room
  */
 void goto_private(void)
 {
@@ -2128,8 +2160,8 @@ void goto_private(void)
 }
 
 
-/*
- * display the screen to zap a room
+/**
+ * \brief display the screen to zap a room
  */
 void display_zap(void)
 {
@@ -2156,15 +2188,16 @@ 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);
@@ -2185,8 +2218,8 @@ void zap(void)
 
 
 
-/*
- * Delete the current room
+/**
+ * \brief Delete the current room
  */
 void delete_room(void)
 {
@@ -2205,8 +2238,8 @@ 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;
@@ -2240,7 +2273,7 @@ void netedit(void) {
                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);
@@ -2277,28 +2310,32 @@ void netedit(void) {
 
 
 
-/*
- * 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) {
@@ -2309,8 +2346,9 @@ void room_to_folder(char *folder, char *room, int floor, int is_mailbox)
 
 
 
-/*
- * Back end for change_view()
+/**
+ * \brief Back end for change_view()
+ * \param newview set newview???
  */
 void do_change_view(int newview) {
        char buf[SIZ];
@@ -2323,8 +2361,8 @@ void do_change_view(int newview) {
 
 
 
-/*
- * Change the view for this room
+/**
+ * \brief Change the view for this room
  */
 void change_view(void) {
        int view;
@@ -2334,8 +2372,11 @@ void change_view(void) {
 }
 
 
-/*
- * 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];
@@ -2346,13 +2387,13 @@ void do_folder_view(struct folder *fold, int max_folders, int num_floors) {
 
        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"
@@ -2442,11 +2483,14 @@ void do_folder_view(struct folder *fold, int max_folders, int num_floors) {
        );
 
        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];
@@ -2469,7 +2513,7 @@ void do_rooms_view(struct folder *fold, int max_folders, int num_floors) {
        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>");
 
@@ -2497,7 +2541,7 @@ void do_rooms_view(struct folder *fold, int max_folders, int num_floors) {
                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");
@@ -2537,21 +2581,27 @@ void do_rooms_view(struct folder *fold, int max_folders, int num_floors) {
                        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];
@@ -2577,14 +2627,14 @@ void do_iconbar_view(struct folder *fold, int max_folders, int num_floors) {
 
                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\" "
@@ -2603,7 +2653,7 @@ void do_iconbar_view(struct folder *fold, int max_folders, int num_floors) {
                        wprintf("&nbsp;");
                        if (levels>2) for (t=0; t<(levels-2); ++t) wprintf("&nbsp;");
 
-                       /* choose the icon */
+                       /** choose the icon */
                        if (fold[i].view == VIEW_ADDRESSBOOK) {
                                icon = "viewcontacts_16x.gif" ;
                        }
@@ -2651,13 +2701,13 @@ void do_iconbar_view(struct folder *fold, int max_folders, int num_floors) {
                                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;
@@ -2679,14 +2729,16 @@ void do_iconbar_view(struct folder *fold, int max_folders, int num_floors) {
        }
 
        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) {
@@ -2699,9 +2751,9 @@ 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);
@@ -2709,16 +2761,16 @@ void list_all_rooms_by_floor(char *viewpref) {
                }
        }
 
-       /* 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));
@@ -2726,7 +2778,7 @@ void list_all_rooms_by_floor(char *viewpref) {
        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")) {
@@ -2741,7 +2793,7 @@ void list_all_rooms_by_floor(char *viewpref) {
                ++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")) {
@@ -2769,7 +2821,7 @@ void list_all_rooms_by_floor(char *viewpref) {
                ++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) {
@@ -2822,15 +2874,17 @@ void list_all_rooms_by_floor(char *viewpref) {
 }
 
 
-/* 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);
@@ -2844,7 +2898,7 @@ void knrooms() {
                strcpy(listviewpref, "rooms");
        }
 
-       /* title bar */
+       /** title bar */
        wprintf("<div id=\"banner\">\n"
                "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
                "<SPAN CLASS=\"titlebar\">"
@@ -2860,7 +2914,7 @@ void knrooms() {
        }
        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"
@@ -2885,15 +2939,15 @@ void knrooms() {
                "</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];
@@ -2918,3 +2972,6 @@ void set_room_policy(void) {
 
        display_editroom();
 }
+
+
+/*@}*/
index c014e0855ef88b2e42535eb8d15139977161fc61..ba1116432db90c338a5a35dac9638e4803a73f30 100644 (file)
@@ -1,16 +1,21 @@
 /*
  * $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");
@@ -30,6 +35,11 @@ void display_rss_control(char *reply_to, char *subject)
 }
 
 
+/**
+ * \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;
@@ -39,11 +49,11 @@ void display_rss(char *roomname, char *request_method)
        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];
@@ -82,7 +92,7 @@ void display_rss(char *roomname, char *request_method)
                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') {
@@ -131,7 +141,7 @@ void display_rss(char *roomname, char *request_method)
        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') {
@@ -150,9 +160,9 @@ void display_rss(char *roomname, char *request_method)
        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;
@@ -168,7 +178,7 @@ void display_rss(char *roomname, char *request_method)
 
                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
@@ -211,7 +221,7 @@ void display_rss(char *roomname, char *request_method)
                        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")) {
@@ -232,7 +242,7 @@ void display_rss(char *roomname, char *request_method)
                        }
                }
 
-               /* 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);
@@ -244,7 +254,7 @@ void display_rss(char *roomname, char *request_method)
                }
 #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;
 
@@ -275,7 +285,7 @@ void display_rss(char *roomname, char *request_method)
                        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")) {
@@ -315,7 +325,7 @@ void display_rss(char *roomname, char *request_method)
                        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);
@@ -328,8 +338,11 @@ ENDITEM:
                now = 0L;
        }
 
-       /* Do RSS footer */
+       /** Do RSS footer */
        wprintf("   </channel>\n");
        wprintf("</rss>\n");
        wDumpContent(0);
 }
+
+
+/*@}*/
index 2fc570fe4367fe54a31d240e3ade6a55e7fc4206..00024976c9d45955be657e5700ebca8c4956604e 100644 (file)
@@ -1,24 +1,28 @@
 /*
  * $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,
@@ -28,12 +32,13 @@ void get_serv_info(char *browser_host, char *user_agent)
        );
        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.
         */
@@ -41,7 +46,7 @@ void get_serv_info(char *browser_host, char *user_agent)
        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')
@@ -88,8 +93,9 @@ void get_serv_info(char *browser_host, char *user_agent)
 
 
 
-/* 
- * 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)
 {
@@ -105,7 +111,8 @@ 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.
                 */
@@ -119,7 +126,7 @@ void fmout(char *align)
                if ((bq == 1) && (!strncmp(buf, " >", 2))) {
                        strcpy(buf, &buf[2]);
                }
-               /* Activate embedded URL's */
+               /** Activate embedded URL's */
                url(buf);
 
                escputs(buf);
@@ -134,8 +141,8 @@ void fmout(char *align)
 
 
 
-/* 
- * 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!)
  */
@@ -151,7 +158,8 @@ void pullquote_fmout(void) {
                }
                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.
                 */
@@ -176,9 +184,10 @@ void pullquote_fmout(void) {
 
 
 
-/*
- * 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)
@@ -228,8 +237,8 @@ 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()
@@ -249,9 +258,11 @@ 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];
@@ -281,8 +292,8 @@ void read_server_binary(char *buffer, size_t total_len) {
 }
 
 
-/*
- * 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.
  */
@@ -317,3 +328,7 @@ char *read_server_text(void) {
 
        return(text);
 }
+
+
+
+/*@}*/
index 25c9a852ea6418ebd7691ce540755d40350fa154..29a65f8972747829122405eca669bd0c4c19382a 100644 (file)
@@ -1,14 +1,17 @@
 /*
  * $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];
@@ -22,7 +25,7 @@ void display_siteconfig(void)
        char purger[SIZ];
        char idxjnl[SIZ];
 
-       /* expire policy settings */
+       /** expire policy settings */
        int sitepolicy = 0;
        int sitevalue = 0;
        int mboxpolicy = 0;
@@ -564,7 +567,9 @@ void display_siteconfig(void)
        wDumpContent(1);
 }
 
-
+/**
+ * parse siteconfig changes 
+ */
 void siteconfig(void)
 {
        char buf[256];
@@ -640,3 +645,6 @@ void siteconfig(void)
                sizeof WC->ImportantMessage);
        display_aide_menu();
 }
+
+
+/*@}*/
index d98178b48b86edfb0bdbcfbb9e201fd3a0a3e602..91408df24fa1699463d5c668f36452edb2c3c85a 100644 (file)
@@ -1,13 +1,14 @@
 /*
  * $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 :-) */
 
@@ -43,6 +50,13 @@ static int needed(const char *fmt, va_list argp)
        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;
@@ -61,6 +75,13 @@ int vsnprintf(char *buf, size_t max, const char *fmt, va_list argp)
        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;
@@ -72,3 +93,7 @@ int snprintf(char *buf, size_t max, const char *fmt,...)
 
        return bytes;
 }
+
+
+
+/*@}*/
index c872650db803cd8846a54c662652819cf5a8586c..6bcaf0fb395741e7d138e7cd78fe569f5d36852e 100644 (file)
@@ -1,17 +1,18 @@
 /*
  * $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;
@@ -33,7 +34,11 @@ void clear_local_substs(void) {
 
 
 /*
- * 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,...)
 {
@@ -42,7 +47,8 @@ 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) {
@@ -52,7 +58,7 @@ void svprintf(char *keyname, int keytype, const char *format,...)
                }
        }
 
-       /* Otherwise allocate a new one */
+       /** Otherwise allocate a new one */
        if (ptr == NULL) {
                ptr = (struct wcsubst *) malloc(sizeof(struct wcsubst));
                ptr->next = WC->vars;
@@ -60,7 +66,7 @@ void svprintf(char *keyname, int keytype, const char *format,...)
                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);
@@ -70,8 +76,10 @@ void svprintf(char *keyname, int keytype, const char *format,...)
        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)() )
 {
@@ -87,8 +95,9 @@ 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];
@@ -114,8 +123,9 @@ void pvo_do_cmd(char *servcmd) {
 
 
 
-/*
- * 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;
@@ -164,7 +174,7 @@ void print_value_of(char *keyname) {
                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) {
@@ -182,8 +192,9 @@ void print_value_of(char *keyname) {
 
 
 
-/*
- * 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];
@@ -241,3 +252,7 @@ void do_template(void *templatename) {
 
        fclose(fp);
 }
+
+
+
+/*@}*/
index 2c3244fecda1db8fa49810483e8e136c0808b077..86ccb8d94d80c3d1ebb8a8591db62a9cbf5ed69d 100644 (file)
@@ -1,13 +1,14 @@
 /*
  * $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;
@@ -51,8 +52,8 @@ void output_date(void) {
 
 
 
-/*
- * Dummy section
+/**
+ * \brief Dummy section
  */
 void dummy_section(void) {
        svprintf("BOXTITLE", WCS_STRING, "(dummy&nbsp;section)");
@@ -62,8 +63,8 @@ void dummy_section(void) {
 }
 
 
-/*
- * New messages section
+/**
+ * \brief New messages section
  */
 void new_messages_section(void) {
        char buf[SIZ];
@@ -102,8 +103,8 @@ void new_messages_section(void) {
 }
 
 
-/*
- * Wholist section
+/**
+ * \brief Wholist section
  */
 void wholist_section(void) {
        char buf[SIZ];
@@ -122,8 +123,8 @@ void wholist_section(void) {
 }
 
 
-/*
- * Task list section
+/**
+ * \brief Task list section
  */
 void tasks_section(void) {
 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
@@ -164,8 +165,8 @@ void tasks_section(void) {
 }
 
 
-/*
- * Calendar section
+/**
+ * \brief Calendar section
  */
 void calendar_section(void) {
 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
@@ -204,8 +205,8 @@ void calendar_section(void) {
        do_template("endbox");
 }
 
-/*
- * Server info section (fluff, really)
+/**
+ * \brief Server info section (fluff, really)
  */
 void server_info_section(void) {
        char message[512];
@@ -224,8 +225,11 @@ void server_info_section(void) {
        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
@@ -236,13 +240,13 @@ void summary_inner_div(void) {
        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%%>");
@@ -250,7 +254,7 @@ void summary_inner_div(void) {
        wprintf("<br />");
        tasks_section();
 
-       /*
+       /**
         * Column Three
         */
        wprintf("</td><td width=33%%>");
@@ -258,15 +262,15 @@ void summary_inner_div(void) {
        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];
@@ -287,7 +291,7 @@ void summary(void) {
        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.
@@ -305,3 +309,6 @@ void summary(void) {
 
        wDumpContent(1);
 }
+
+
+/*@}*/
index 0a3fd8d62f797efe1f61b7fd923d0ecf8d1724bc..664a8b700490cadc5edc5b8e4d8a311e56ecb4ce 100644 (file)
@@ -1,14 +1,20 @@
 /*
  * $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)
@@ -57,8 +63,11 @@ void display_edit(char *description, char *check_cmd,
 }
 
 
-/*
- * 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)
 {
@@ -91,3 +100,6 @@ void save_edit(char *description, char *enter_cmd, int regoto)
                return;
        }
 }
+
+
+/*@}*/
index 92e88ef56a238fc95aaef6d024c4a245a549f05f..6ee6ae8200732e25c197d1a1c65f8562b573c265 100644 (file)
@@ -1,11 +1,17 @@
 /*
  * $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;
 
@@ -45,6 +51,11 @@ void tabbed_dialog(int num_tabs, char *tabnames[]) {
        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,
@@ -52,6 +63,11 @@ void begin_tab(int tabnum, int num_tabs) {
        );
 }
 
+/**
+ * \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");
 
@@ -59,3 +75,6 @@ void end_tab(int tabnum, int num_tabs) {
                wprintf("</td></tr></table>\n");
        }
 }
+
+
+/*@}*/
index 80656a97480c0a54675a8d8eb11135e1d4c1d2ed..dfd62befbace686bd4bb4b49c808ccbce0309176 100644 (file)
@@ -1,9 +1,11 @@
 /*
  * $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");
@@ -20,8 +27,9 @@ RETSIGTYPE timeout(int signum)
 }
 
 
-/*
- * 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)
 {
@@ -50,8 +58,10 @@ 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)
 {
@@ -108,8 +118,10 @@ 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)
 {
@@ -133,8 +145,8 @@ void serv_read(char *buf, int bytes)
 }
 
 
-/*
- * input string from pipe
+/**
+ * \brief input string from pipe
  */
 void serv_getln(char *strbuf, int bufsize)
 {
@@ -157,8 +169,10 @@ 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)
 {
@@ -181,8 +195,9 @@ 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)
 {
@@ -196,8 +211,10 @@ 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,...)
 {
@@ -214,3 +231,6 @@ void serv_printf(const char *format,...)
        lprintf(9, "<%s", buf);
 #endif
 }
+
+
+/*@}*/
index a4c7c2c20dfa98e8aff0034e4b4f28b13f3bf3ff..ba9921107e7dddd3a25af814c37f748b000ec1c0 100644 (file)
@@ -1,20 +1,29 @@
 /*
  * $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) {
@@ -27,8 +36,11 @@ char *safestrncpy(char *dest, const char *src, size_t n)
 
 
 
-/*
- * 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)
 {
@@ -44,8 +56,13 @@ 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)
 {
@@ -79,8 +96,11 @@ void extract_token(char *dest, const char *source, int parmnum, char separator,
 
 
 
-/*
- * 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)
 {
@@ -121,8 +141,11 @@ 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)
 {
@@ -132,8 +155,11 @@ 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)
 {
@@ -148,8 +174,11 @@ 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[];
@@ -164,15 +193,18 @@ char ch;
 }
 
 
-/*
- * 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);
@@ -192,8 +224,11 @@ char *memreadline(char *start, char *buf, int 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)
 {
@@ -206,8 +241,9 @@ 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)
 {
@@ -220,9 +256,12 @@ 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;
@@ -258,11 +297,15 @@ int is_msg_in_mset(char *mset, long msgnum) {
 
 
 
-/*
- * 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)
 {
@@ -291,8 +334,9 @@ 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)
 {
@@ -305,9 +349,13 @@ 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)
@@ -317,7 +365,7 @@ 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;
@@ -352,9 +400,11 @@ void CtdlEncodeBase64(char *dest, const char *source, size_t sourcelen)
                                   (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] = '=';
@@ -384,9 +434,13 @@ void CtdlEncodeBase64(char *dest, const char *source, size_t sourcelen)
 }
 
 
-/* 
- * 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)
 {
@@ -410,7 +464,7 @@ 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++) {
@@ -426,7 +480,7 @@ int CtdlDecodeBase64(char *dest, const char *source, size_t length)
                                return (dpos);
                        }
                        if (dtable[c] & 0x80) {
-                               /* Ignoring errors: discard invalid character */
+                               /** Ignoring errors: discard invalid character */
                                i--;
                                continue;
                        }
@@ -452,8 +506,9 @@ int CtdlDecodeBase64(char *dest, const char *source, size_t length)
 
 
 
-/*
- * 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;
@@ -467,9 +522,12 @@ void generate_uuid(char *buf) {
 }
 
 
-/*
- * 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;
@@ -484,3 +542,7 @@ void CtdlMakeTempFileName(char *name, int len) {
                }
        }
 }
+
+
+
+/*@}*/
index f1c872f9b6a2a3905c0b59fe281541798e384e2a..a37a61673183d8eeef9b9a99d340feeccccb9f83 100644 (file)
@@ -1,15 +1,21 @@
 /*
  * $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];
@@ -87,8 +93,11 @@ void select_user_to_edit(char *message, char *preselect)
 
 
 
-/* 
- * 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];
@@ -106,7 +115,7 @@ long locate_user_vcard(char *username, long usernum) {
        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")) {
@@ -116,7 +125,7 @@ TRYAGAIN:
                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);
@@ -138,7 +147,7 @@ TRYAGAIN:
                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");
@@ -157,8 +166,10 @@ TRYAGAIN:
 }
 
 
-/* 
- * 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];
@@ -166,7 +177,7 @@ void display_edit_address_book_entry(char *username, long usernum) {
        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);
@@ -201,12 +212,15 @@ void display_edit_address_book_entry(char *username, long usernum) {
 
 
 
-/*
- * 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];
@@ -372,7 +386,9 @@ void display_edituser(char *supplied_username, int is_new) {
 }
 
 
-
+/**
+ * \brief do the backend operation of the user edit on the server
+ */
 void edituser(void) {
        char message[SIZ];
        char buf[SIZ];
@@ -415,7 +431,8 @@ void edituser(void) {
                }
        }
 
-       /* 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) {
@@ -426,7 +443,10 @@ void edituser(void) {
        }
 }
 
-
+/**
+ * \brief burge a user 
+ * \param username the name of the user to remove
+ */
 void delete_user(char *username) {
        char buf[SIZ];
        char message[SIZ];
@@ -446,7 +466,10 @@ void delete_user(char *username) {
                
 
 
-
+/**
+ * \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];
@@ -471,3 +494,6 @@ void create_user(void) {
 
 }
 
+
+
+/*@}*/
index a0bced0ae006d921b739528f61a6a8c9cda57f06..2e11dd767f74ff588eb89b72714f389e0be450d5 100644 (file)
@@ -1,19 +1,24 @@
 /*
  * $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)
 {
@@ -99,8 +104,8 @@ DONE:        wDumpContent(1);
 }
 
 
-/*
- * Display (non confidential) information about a particular user
+/**
+ * \brief Display (non confidential) information about a particular user
  */
 void showuser(void)
 {
@@ -158,3 +163,6 @@ void showuser(void)
        wprintf("</td></tr></table></div>\n");
        wDumpContent(1);
 }
+
+
+/*@}*/
index fd170bb6ed402c446cac56ce31d509d508fea4c6..e785abdc2adf900f3058d33b25c63a1e77644372 100644 (file)
@@ -1,19 +1,21 @@
 /*
  * $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;
@@ -29,8 +31,10 @@ struct vCard *vcard_new() {
 }
 
 
-/*
- * 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;
@@ -44,7 +48,8 @@ struct vCard *vcard_load(char *vtext) {
        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.
         */
@@ -110,13 +115,19 @@ struct vCard *vcard_load(char *vtext) {
 }
 
 
-/*
- * 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) {
@@ -147,8 +158,10 @@ char *vcard_get_prop(struct vCard *v, char *propname,
 
 
 
-/*
- * Destructor
+/**
+ * \brief Destructor
+ * kill a vCard
+ * \param v the vCard to purge from memory
  */
 void vcard_free(struct vCard *v) {
        int i;
@@ -169,15 +182,19 @@ void vcard_free(struct vCard *v) {
 
 
 
-/*
- * 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);
@@ -188,7 +205,7 @@ void vcard_set_prop(struct vCard *v, char *name, char *value, int append) {
                }
        }
 
-       /* Otherwise, append it */
+       /** Otherwise, append it */
        ++v->numprops;
        v->prop = realloc(v->prop,
                (v->numprops * sizeof(struct vCardProp)) );
@@ -199,9 +216,10 @@ void vcard_set_prop(struct vCard *v, char *name, char *value, int append) {
 
 
 
-/*
- * 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)
 {
@@ -209,10 +227,10 @@ 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) +
@@ -233,3 +251,7 @@ char *vcard_serialize(struct vCard *v)
 
        return ser;
 }
+
+
+
+/*@}*/
index c8fbcfec8a3b4c580ada3605a37eb2d64ebb955a..fa8ce33bd136efdcbe9705d3512d78d6cb92b07e 100644 (file)
@@ -1,26 +1,27 @@
 /*
  * $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??? */
 };
 
 
@@ -31,3 +32,6 @@ void vcard_set_prop(struct vCard *v, char *name, char *value, int append);
 char *vcard_get_prop(struct vCard *v, char *propname, int is_partial,
                        int instance, int return_propname);
 char *vcard_serialize(struct vCard *);
+
+
+/*@}*/
index 755dae6fc9472e566b55d8d2d218bf58b7b7988c..2a77b7c38f967bdfc7f5d1f81d73886667b43183 100644 (file)
@@ -1,16 +1,22 @@
 /*
  * $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];
@@ -169,7 +175,7 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) {
                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>"
@@ -335,7 +341,9 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) {
 }
 
 
-
+/**
+ * \brief commit the edits to the citadel server
+ */
 void edit_vcard(void) {
        long msgnum;
        char *partnum;
@@ -347,7 +355,9 @@ void edit_vcard(void) {
 
 
 
-
+/**
+ * \brief parse edited vcard from the browser
+ */
 void submit_vcard(void) {
        char buf[SIZ];
        int i;
@@ -410,3 +420,7 @@ void submit_vcard(void) {
                readloop("readnew");
        }
 }
+
+
+
+/*@}*/
index 566720800a23fcd24c4c4252bf2ed17ce8021d5d..641b356157f0acc2e4d1e45d185f9fbdce317724 100644 (file)
@@ -1,32 +1,37 @@
 /*
  * $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;
@@ -51,7 +56,10 @@ void unescape_input(char *buf)
 
 }
 
-
+/**
+ * \brief add urls???
+ * \param url what???
+ */
 void addurls(char *url)
 {
        char *up, *ptr;
@@ -62,7 +70,7 @@ void addurls(char *url)
        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)
@@ -77,11 +85,11 @@ void addurls(char *url)
                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) {
@@ -105,6 +113,9 @@ void addurls(char *url)
        }
 }
 
+/**
+ * \brief free urlstring memory
+ */
 void free_urls(void)
 {
        struct urlcontent *u;
@@ -117,8 +128,8 @@ void free_urls(void)
        }
 }
 
-/*
- * Diagnostic function to display the contents of all variables
+/**
+ * \brief Diagnostic function to display the contents of all variables
  */
 void dump_vars(void)
 {
@@ -129,6 +140,10 @@ void dump_vars(void)
        }
 }
 
+/**
+ * \brief what???
+ * \param key what???
+ */
 char *bstr(char *key)
 {
        struct urlcontent *u;
@@ -140,7 +155,11 @@ char *bstr(char *key)
        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;
@@ -154,10 +173,10 @@ void wprintf(const char *format,...)
 }
 
 
-/*
- * 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.
  */
@@ -175,9 +194,12 @@ void wDumpContent(int print_standard_html_footer)
 }
 
 
-/*
- * 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)
 {
@@ -212,6 +234,12 @@ 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;
@@ -223,14 +251,20 @@ void escputs1(char *strbuf, int nbsp, int nolinebreaks)
        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)
 {
@@ -253,6 +287,10 @@ 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];
@@ -262,8 +300,10 @@ void urlescputs(char *strbuf)
 }
 
 
-/*
- * 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)
 {
@@ -287,6 +327,10 @@ void jsesc(char *target, char *strbuf)
        }
 }
 
+/**
+ * \brief escape and print java script
+ * \param strbuf the js code
+ */
 void jsescputs(char *strbuf)
 {
        char outbuf[SIZ];
@@ -295,8 +339,10 @@ void jsescputs(char *strbuf)
        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)
 {
@@ -316,6 +362,10 @@ void msgesc(char *target, char *strbuf)
        }
 }
 
+/**
+ * \brief print message to the client ???
+ * \param strbuf message to print???
+ */
 void msgescputs(char *strbuf) {
        char *outbuf;
 
@@ -329,19 +379,20 @@ void msgescputs(char *strbuf) {
 
 
 
-/*
- * 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];
@@ -387,11 +438,11 @@ void output_headers(      int do_httpheaders,     /* 1 = output HTTP headers
                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\">"
@@ -406,7 +457,7 @@ void output_headers(        int do_httpheaders,     /* 1 = output HTTP headers
                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>");
                }
@@ -424,8 +475,9 @@ void output_headers(        int do_httpheaders,     /* 1 = output HTTP headers
 }
 
 
-/*
- * 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");
@@ -439,8 +491,8 @@ void http_redirect(char *whichpage) {
 
 
 
-/* 
- * 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) {
@@ -454,7 +506,7 @@ void http_transmit_thing(char *thing, size_t length, char *content_type,
                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;
@@ -478,7 +530,7 @@ void http_transmit_thing(char *thing, size_t length, char *content_type,
        }
 #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
@@ -488,7 +540,10 @@ void http_transmit_thing(char *thing, size_t length, char *content_type,
 
 
 
-
+/**
+ * \brief dump out static pages from disk
+ * \param what the file urs to print
+ */
 void output_static(char *what)
 {
        FILE *fp;
@@ -552,8 +607,8 @@ void output_static(char *what)
 }
 
 
-/*
- * 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()
@@ -568,17 +623,18 @@ 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");
@@ -588,9 +644,11 @@ void output_image()
 
 }
 
-/*
- * 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)
 {
@@ -622,8 +680,10 @@ 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)
 {
@@ -653,8 +713,11 @@ 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)
 {
@@ -672,8 +735,8 @@ 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);
@@ -681,8 +744,8 @@ void blank_page(void) {
 }
 
 
-/*
- * A template has been requested
+/**
+ * \brief A template has been requested
  */
 void url_do_template(void) {
        do_template(bstr("template"));
@@ -690,8 +753,8 @@ void url_do_template(void) {
 
 
 
-/*
- * 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=");
@@ -709,8 +772,8 @@ void offer_start_page(void) {
 }
 
 
-/* 
- * Change the user's start page
+/**
+ * \brief Change the user's start page
  */
 void change_start_page(void) {
 
@@ -731,15 +794,21 @@ 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");
@@ -753,7 +822,19 @@ void authorization_required(const char *message)
        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)
@@ -774,7 +855,7 @@ void upload_handler(char *name, char *filename, char *partnum, char *disp,
                u->url_data[length] = 0;
        }
 
-       /* Uploaded files */
+       /** Uploaded files */
        if ( (length > 0) && (strlen(cbtype) > 0) ) {
                WC->upload = malloc(length);
                if (WC->upload != NULL) {
@@ -792,8 +873,8 @@ void upload_handler(char *name, char *filename, char *partnum, char *disp,
 
 }
 
-/*
- * 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);
@@ -807,11 +888,17 @@ void begin_ajax_response(void) {
         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];
@@ -854,7 +941,8 @@ void ajax_servcmd(void)
 
        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.
@@ -865,8 +953,8 @@ void ajax_servcmd(void)
 }
 
 
-/*
- * 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)
@@ -893,8 +981,8 @@ void seconds_since_last_gexp(void)
 
 
 
-/*
- * Entry point for WebCit transaction
+/**
+ * \brief Entry point for WebCit transaction
  */
 void session_loop(struct httprequest *req)
 {
@@ -922,7 +1010,8 @@ 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];
@@ -954,7 +1043,7 @@ void session_loop(struct httprequest *req)
        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;
@@ -1030,7 +1119,7 @@ void session_loop(struct httprequest *req)
                        }
                        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;
                }
@@ -1044,7 +1133,7 @@ void session_loop(struct httprequest *req)
                                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);
 
@@ -1060,12 +1149,12 @@ void session_loop(struct httprequest *req)
                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)
@@ -1077,7 +1166,7 @@ void session_loop(struct httprequest *req)
        }
 
 
-       /* 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])) {
@@ -1101,7 +1190,7 @@ void session_loop(struct httprequest *req)
                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.
         */
@@ -1122,9 +1211,10 @@ void session_loop(struct httprequest *req)
                }
                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.
@@ -1151,7 +1241,7 @@ void session_loop(struct httprequest *req)
                }
        }
 
-       /*
+       /**
         * Functions which can be performed without logging in
         */
        if (!strcasecmp(action, "listsub")) {
@@ -1165,7 +1255,7 @@ void session_loop(struct httprequest *req)
        }
 #endif
 
-       /*
+       /**
         * If we're not logged in, but we have HTTP Authentication data,
         * try logging in to Citadel using that.
         */
@@ -1183,20 +1273,20 @@ void session_loop(struct httprequest *req)
                                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.
         */
@@ -1210,20 +1300,20 @@ void session_loop(struct httprequest *req)
        }
 
 
-       /*
+       /**
         * 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.
         */
@@ -1240,7 +1330,7 @@ void session_loop(struct httprequest *req)
                        }
                }
        }
-       /*
+       /**
         * If we don't have a current room, but a cookie specifying the
         * current room is supplied, make an effort to go there.
         */
@@ -1255,17 +1345,17 @@ void session_loop(struct httprequest *req)
        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...
         */
 
@@ -1533,7 +1623,7 @@ void session_loop(struct httprequest *req)
                wDumpContent(1);
        }
 
-       /* When all else fais, display the main menu. */
+       /** When all else fais, display the main menu. */
        else {
                display_main_menu();
        }
@@ -1550,3 +1640,6 @@ SKIP_ALL_THIS_CRAP:
                WC->upload_length = 0;
        }
 }
+
+
+/*@}*/
index dba84007391eabd4a36fdc8a1ccd45ce3feee0b5..b844ef949c1388e0860fcfcc127c3f0ee35d0b65 100644 (file)
  *
  * 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))
index 963a11422856a58eb1f8c2f77e47bcce3ce426b2..9d7829c3d6ca05fb62cdd720f51d89d4340c8a89 100644 (file)
@@ -1,41 +1,44 @@
 /*
  * $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)
 {
@@ -65,7 +68,7 @@ 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));
 
@@ -82,8 +85,10 @@ int ig_tcp_server(char *ip_addr, int port_number, int queue_len)
 
 
 
-/*
- * 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)
 {
@@ -132,12 +137,16 @@ 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)
 {
@@ -183,7 +192,11 @@ 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)
 {
 
@@ -208,7 +221,9 @@ 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) {
@@ -220,22 +235,25 @@ void begin_burst(void)
 }
 
 
-/*
- * 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 */
@@ -281,6 +299,9 @@ int ZEXPORT compress_gzip(Bytef * dest, uLongf * destLen,
 }
 #endif
 
+/**
+ * \brief what burst???
+ */
 void end_burst(void)
 {
        size_t the_len;
@@ -326,10 +347,13 @@ void end_burst(void)
 
 
 
-/*
- * 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)
 {
@@ -337,30 +361,32 @@ 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;
@@ -371,8 +397,9 @@ int client_getln(int sock, char *buf, int bufsiz)
 }
 
 
-/*
- * 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)
 {
@@ -390,17 +417,18 @@ 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.
         */
@@ -410,26 +438,28 @@ void spawn_another_worker_thread()
                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;
@@ -437,11 +467,11 @@ int main(int argc, char **argv)
        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
@@ -506,7 +536,7 @@ int main(int argc, char **argv)
                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 "
@@ -518,7 +548,7 @@ int main(int argc, char **argv)
                perror("chdir");
        }
 
-       /* initialize the International Bright Young Thing */
+       /** initialize the International Bright Young Thing */
 #ifdef ENABLE_NLS
 
        initialize_locales();
@@ -542,7 +572,7 @@ int main(int argc, char **argv)
        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.
@@ -551,7 +581,7 @@ int main(int argc, char **argv)
                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
@@ -563,7 +593,7 @@ int main(int argc, char **argv)
        }
 #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.
@@ -583,7 +613,7 @@ int main(int argc, char **argv)
 
        pthread_mutex_init(&SessionListMutex, NULL);
 
-       /*
+       /**
         * Start up the housekeeping thread
         */
        pthread_attr_init(&attr);
@@ -592,7 +622,7 @@ int main(int argc, char **argv)
                       (void *(*)(void *)) housekeeping_loop, NULL);
 
 
-       /*
+       /**
         * If this is an HTTPS server, fire up SSL
         */
 #ifdef HAVE_OPENSSL
@@ -601,7 +631,7 @@ int main(int argc, char **argv)
        }
 #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();
        }
@@ -612,7 +642,7 @@ int main(int argc, char **argv)
 }
 
 
-/*
+/**
  * Entry point for worker threads
  */
 void worker_entry(void)
@@ -623,19 +653,19 @@ 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) {
@@ -646,9 +676,9 @@ void worker_entry(void)
 #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);
                        }
 
@@ -659,7 +689,13 @@ void worker_entry(void)
        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;
@@ -672,3 +708,6 @@ int lprintf(int loglevel, const char *format, ...)
        }
        return 1;
 }
+
+
+/*@}*/
index 341b9bdf6f15f4842d58f5cbb31aed8e64884b3a..abd807705c2da521160562ac6fd838af96e93b11 100644 (file)
@@ -1,15 +1,16 @@
 /*
  * $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],
@@ -64,7 +65,7 @@ void who_inner_div(void) {
                        }
                        wprintf("</td>");
 
-                       /* (link to page this user) */
+                       /** (link to page this user) */
                        wprintf("<td><a href=\"display_page?recp=");
                        urlescputs(user);
                        wprintf("\">"
@@ -74,7 +75,7 @@ void who_inner_div(void) {
                                " border=\"0\" /></a> ");
                        wprintf("</td>");
 
-                       /* (idle flag) */
+                       /** (idle flag) */
                        wprintf("<td>");
                        if ((now - last_activity) > 900L) {
                                wprintf(" "
@@ -92,14 +93,14 @@ void who_inner_div(void) {
 
 
 
-                       /* 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) {
@@ -109,7 +110,7 @@ void who_inner_div(void) {
                        }
                        wprintf("</td>\n\t<td>");
 
-                       /* hostname */
+                       /** hostname */
                        escputs(host);
                        if (strlen(realhost) > 0) {
                                wprintf("<br /><i>");
@@ -123,8 +124,8 @@ void who_inner_div(void) {
 }
 
 
-/*
- * who is on?
+/**
+ * \brief who is on?
  */
 void who(void)
 {
@@ -167,7 +168,8 @@ 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
@@ -182,7 +184,9 @@ void who(void)
        wDumpContent(1);
 }
 
-
+/**
+ * \brief end session \todo what??? does this belong here? 
+ */
 void terminate_session(void)
 {
        char buf[SIZ];
@@ -193,8 +197,8 @@ void terminate_session(void)
 }
 
 
-/*
- * Change your session info (fake roomname and hostname)
+/**
+ * \brief Change your session info (fake roomname and hostname)
  */
 void edit_me(void)
 {
@@ -271,3 +275,6 @@ void edit_me(void)
                wDumpContent(1);
        }
 }
+
+
+/*@}*/