A bit more doxygen
authorRichard Kettlewell <rjk@greenend.org.uk>
Sun, 26 Oct 2008 12:17:38 +0000 (12:17 +0000)
committerRichard Kettlewell <rjk@greenend.org.uk>
Sun, 26 Oct 2008 12:17:38 +0000 (12:17 +0000)
lib/alsabg.c
lib/alsabg.h
lib/arcfour.c
lib/arcfour.h
lib/authhash.c

index 27c5c6e..56e5c6a 100644 (file)
  */
 /** @file alsabg.c
  * @brief Background-thread interface to ALSA
+ *
+ * This wraps ALSA with an interface which calls back to the client from a
+ * thread.  It's not intended for completely general use, just what DisOrder
+ * needs.
+ *
+ * Only builds on Linux systems.
  */
 
 #include "common.h"
@@ -273,6 +279,10 @@ void alsa_bg_init(const char *device,
   ep(pthread_create(&alsa_bg_play_tid, 0, alsa_bg_play, 0));
 }
 
+/** @brief Deinitialize background ALSA playback
+ *
+ * The opposite of alsa_bg_init().
+ */
 void alsa_bg_close(void) {
   void *r;
 
index b378f6f..78c83dc 100644 (file)
@@ -29,6 +29,7 @@
 /** @brief Supply audio callback
  * @param dst Where to write audio data
  * @param nsamples Number of samples to write
+ * @return Number of samples written
  *
  * This function should write up to @p *nsamples samples of data at
  * @p dst, and return the number of samples written, or -1 if some error
index 7d469d8..3450562 100644 (file)
 
 #include "arcfour.h"
 
+/** @brief Encrypt using Arcfour stream cipher
+ * @param context Context structure
+ * @param inbuf Input buffer
+ * @param outbuf Output buffer
+ * @param length Number of bytes in @p inbuf
+ *
+ * Copies from @p inbuf to @p outbuf, encrypting (or decrypting) using
+ * the stream controlled by @p context.
+ */
 void
 arcfour_stream (arcfour_context * context, const char *inbuf, char *outbuf,
                size_t length)
@@ -56,6 +65,13 @@ arcfour_stream (arcfour_context * context, const char *inbuf, char *outbuf,
   context->idx_j = j;
 }
 
+/** @brief Initialize an @ref arcfour_context
+ * @param context Context structure
+ * @param key Key data
+ * @param keylen Length of key
+ *
+ * Initializes @p context using @p key.
+ */
 void
 arcfour_setkey (arcfour_context * context, const char *key, size_t keylen)
 {
index af6e941..4993961 100644 (file)
@@ -32,6 +32,7 @@
 
 #define ARCFOUR_SBOX_SIZE 256
 
+/** @brief Context structture for Arcfour stream cipher */
 typedef struct
 {
   char sbox[ARCFOUR_SBOX_SIZE];
index 9d36fef..d5da9c5 100644 (file)
 
 /** @brief Structure of algorithm lookup table */
 struct algorithm {
+  /** @brief DisOrder algorithm name */
   const char *name;
+
+  /** @brief gcrypt algorithm ID */
   int id;
 };
 
@@ -56,6 +59,7 @@ static const struct algorithm algorithms[] = {
  * @param nchallenge Size of challenge
  * @param password Password
  * @param algo Algorithm to use
+ * @return Hex string or NULL on error
  *
  * Computes H(challenge|password) and returns it as a newly allocated hex
  * string, or returns NULL on error.