# HG changeset patch # User Nicolas Cornu # Date 1281994609 -7200 # Node ID dde8eaf7ff2c4c0dc033b559170ef922628c0021 # Parent 14ef2cb0bd2beb8c4c3f3de5f993ba020e6aad22 More docs diff -r 14ef2cb0bd2b -r dde8eaf7ff2c jingle-filetransfer/filetransfer.c --- a/jingle-filetransfer/filetransfer.c Mon Aug 16 20:57:30 2010 +0200 +++ b/jingle-filetransfer/filetransfer.c Mon Aug 16 23:36:49 2010 +0200 @@ -18,7 +18,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ - #include "config.h" #include @@ -98,6 +97,14 @@ }; +/** + * \fn static gconstpointer check(JingleContent *cn, GError **err) + * \brief Check if a node description with xmlns of JFT is correct + * + * \param cn the jinglecontent a node description + * \param err contain an error of the domain JINGLE_CHECK_ERROR + * \return a gconstpointer, which is a new allocated JingleFT + */ static gconstpointer check(JingleContent *cn, GError **err) { JingleFT *ft = NULL; @@ -188,6 +195,15 @@ return (gconstpointer) ft; } +/** + * \fn static gboolean handle(JingleAction action, gconstpointer data, LmMessageNode *node) + * \brief handle a function to handle action which are not "current" + * + * \param action the action which have been received + * \param data contain the JingleFT of the content concerned + * \param node the node himself + * \return a gconstpointer, which is a new allocated JingleFT + */ static gboolean handle(JingleAction action, gconstpointer data, LmMessageNode *node) { diff -r 14ef2cb0bd2b -r dde8eaf7ff2c jingle-filetransfer/filetransfer.h --- a/jingle-filetransfer/filetransfer.h Mon Aug 16 20:57:30 2010 +0200 +++ b/jingle-filetransfer/filetransfer.h Mon Aug 16 23:36:49 2010 +0200 @@ -1,68 +1,126 @@ #ifndef __JINGLEFT_H__ #define __JINGLEFT_H__ 1 +/** + * \file filetransfer.h + * \brief The main file of app-module to the file transfer XEP 234 + * \author Nicolas Cornu + * \version 0.1 + */ + #define NS_JINGLE_APP_FT "urn:xmpp:jingle:apps:file-transfer:1" #define NS_JINGLE_APP_FT_INFO "urn:xmpp:jingle:apps:file-transfer:info:1" #define NS_SI_FT "http://jabber.org/protocol/si/profile/file-transfer" #define JINGLE_FT_SIZE_READ 2048 +/** + * \enum JingleFTType + * \brief type of the content + */ typedef enum { JINGLE_FT_OFFER, JINGLE_FT_REQUEST, } JingleFTType; +/** + * \enum JingleFTDirection + * \brief Direction of the file + */ typedef enum { - JINGLE_FT_INCOMING, - JINGLE_FT_OUTGOING + JINGLE_FT_INCOMING, /*!< We download the file */ + JINGLE_FT_OUTGOING /*!< We upload the file */ } JingleFTDirection; +/** + * \enum JingleFTState + * \brief state of the file + */ typedef enum { - JINGLE_FT_PENDING, - JINGLE_FT_STARTING, - JINGLE_FT_ENDING, - JINGLE_FT_REJECT, - JINGLE_FT_ERROR + JINGLE_FT_PENDING, /*!< The file isn't yet accepted by the both parts */ + JINGLE_FT_STARTING, /*!< The file is transfering */ + JINGLE_FT_ENDING, /*!< The file has been transfered */ + JINGLE_FT_REJECT, /*!< The transfer has been refused */ + JINGLE_FT_ERROR /*!< And error occured during the transfer */ } JingleFTState; +/** + * \struct JingleFT + * \brief represent the file transfer himself + */ typedef struct { - /* the last modification of the file, optional */ + /** + * the last modification of the file, optional + */ time_t date; - /* MD5 hash of the file, optional */ + /** + * MD5 hash of the file, optional + */ gchar *hash; - /* the name of the file that the sender wishes to send */ + /** + * the name of the file that the sender wishes to send + */ gchar *name; - /* the size, in bytes, of the data to be sent */ + /** + * the size, in bytes, of the data to be sent + */ guint64 size; - /* Data already send/receive*/ + /** + * Data already send/receive + */ guint64 transmit; - /* descriptor to the output file */ + /** + * descriptor to the output file + */ GIOChannel *outfile; - /* Is it an offer or a request ? */ + /** + * Is it an offer or a request ? + */ JingleFTType type; - /* Is it if the file is incoming or outgoing */ + /** + * Is it if the file is incoming or outgoing + */ JingleFTDirection dir; - /* The state of the file (PENDING, STARTING, ...) */ + /** + * The state of the file (PENDING, STARTING, ...) + */ JingleFTState state; - /* A little description of the transfer */ + /** + * A little description of the transfer + */ gchar *desc; - /* Where we compute the hash */ + /** + * Where we compute the hash + */ GChecksum *md5; } JingleFT; +/** + * \struct JingleFTInfo + * \brief contain only a link to the gconstpointer + * + * We keep localy a list of all the files transfered to print infos + * + */ typedef struct { + /** + * An index. Not use now, but will in the futur to cancel a transfer. + */ int index; + /** + * The link to the JingleFT in the session. + */ JingleFT *jft; } JingleFTInfo; #endif diff -r 14ef2cb0bd2b -r dde8eaf7ff2c jingle/jingle.h --- a/jingle/jingle.h Mon Aug 16 20:57:30 2010 +0200 +++ b/jingle/jingle.h Mon Aug 16 23:36:49 2010 +0200 @@ -1,9 +1,9 @@ #ifndef __JINGLE_H__ #define __JINGLE_H__ 1 -/*! +/** * \file jingle.h - * \brief Lecteur de musique de base + * \brief * \author Nicolas Cornu * \version 0.1 */