aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2024-07-04 10:55:40 -0400
committerEugene Triguba <eugenetriguba@gmail.com>2024-07-04 10:55:40 -0400
commit26fe1ae8c07c949fb7f0880386c7bfee6cd220f7 (patch)
tree1c595573f215ffc589a2bc975a97277357fa7591
parentFormat files (diff)
downloadcli-26fe1ae8c07c949fb7f0880386c7bfee6cd220f7.zip
Fix docs
-rw-r--r--src/linebuffer.h55
-rw-r--r--src/word.h11
2 files changed, 33 insertions, 33 deletions
diff --git a/src/linebuffer.h b/src/linebuffer.h
index 00135f6..173bad3 100644
--- a/src/linebuffer.h
+++ b/src/linebuffer.h
@@ -12,74 +12,63 @@ typedef struct {
} LineBuffer;
/**
- * Create a new LineBuffer
+ * @brief Create a new LineBuffer
*
- * Args:
- * line_length: The length of the buffer to use.
+ * @param line_length The length of the buffer to use.
*
- * Returns:
- * The newly allocated LineBuffer; otherwise NULL
- * if the allocation fails.
+ * @returns The newly allocated LineBuffer; otherwise NULL
+ * if the allocation fails.
*/
LineBuffer *linebuffer_create(size_t line_length);
/**
- * Release any allocated memory for the LineBuffer
+ * @brief Release any allocated memory for the LineBuffer
*
- * Args:
- * lb: The LineBuffer to destroy.
+ * @param lb The LineBuffer to destroy.
*/
void linebuffer_destroy(LineBuffer *lb);
/**
- * Clear the current buffer
+ * @brief Clear the current buffer
*
- * Args:
- * lb: The LineBuffer to clear.
+ * @param lb The LineBuffer to clear.
*/
void linebuffer_clear(LineBuffer *lb);
/**
- * Append a word to the end of the buffer.
+ * @brief Append a word to the end of the buffer.
*
- * Args:
- * lb: The line buffer to append to.
- * word: The word to append.
+ * @param lb The line buffer to append to.
+ * @param word The word to append.
*/
void linebuffer_append_word(LineBuffer *lb, const char *word);
/**
- * Check how many characters can be added.
+ * @brief Check how many characters can be added.
*
- * Args:
- * lb: The line buffer to check the space of.
+ * @param lb The line buffer to check the space of.
*
- * Returns:
- * The number of characters left in the line.
+ * @returns The number of characters left in the line.
*/
size_t linebuffer_space_remaining(LineBuffer *lb);
/**
- * Write the current line.
+ * @brief Write the current line.
*
- * Args:
- * lb: The line buffer to read.
- * fp: The file to write out the line buffer to.
+ * @param lb The line buffer to read.
+ * @param fp The file to write out the line buffer to.
*
- * Returns:
- * >= 0 on success; EOF on error.
+ * @returns >= 0 on success; EOF on error.
*/
int linebuffer_write(LineBuffer *lb, FILE *fp);
/**
- * Write the current line as justified text.
+ * @brief Write the current line as justified text.
*
- * Args:
- * lb: The line buffer to read.
- * fp: The file to write out the line buffer to.
+ * @param lb The line buffer to read.
+ * @param fp The file to write out the line buffer to.
*
- * Returns:
- * >= 0 on success; EOF on error.
+ * @returns >= 0 on success; EOF on error.
*/
int linebuffer_write_justified(LineBuffer *lb, FILE *fp);
diff --git a/src/word.h b/src/word.h
index 77afbdc..f7006a3 100644
--- a/src/word.h
+++ b/src/word.h
@@ -3,6 +3,17 @@
#include <stdio.h>
+/**
+ * Read in a word from a file up to size length.
+ *
+ * @param fp[in] The file to read a word from.
+ * @param word[out] The word that was read as a null-terminated string.
+ * @param length[in] The length of the word to read in.
+ *
+ * @note `length` should be the number of characters you'd
+ * like to read in plus one to take into account the
+ * null terminator.
+ */
int read_word(FILE *fp, char *word, size_t length);
#endif