chiark / gitweb /
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 27c5c6e8a01e5ad29555103d77f4ce7c8b64537d..56e5c6aa2711909e779bbe130001747ea033774c 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 b378f6fd2a246eb9223ac728284209480f1084aa..78c83dc156a01d2384d41f661e613475ee90769e 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 7d469d8a7b0ab988f0a3d0a7e3d049fce13828d8..34505628372061f28c4eaeb109abcc07d9941de2 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 af6e9414a6091553431bb13a9853341b2ab3bc78..4993961066a2d641b4c2d65bd2bcf5bae0d9a9df 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 9d36fefd40124264b27a60b4dcb5263e6916f683..d5da9c5e48ce97470543adeac9c7a593e4f37aa3 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.