From 1536f1e0287b8281014200ef6911b294272c4773 Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Wed, 11 Jun 2025 19:39:52 -0500 Subject: Start fixing the encryption scheme --- src/shared.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/shared.h') diff --git a/src/shared.h b/src/shared.h index 6276281..94c6f06 100644 --- a/src/shared.h +++ b/src/shared.h @@ -62,7 +62,7 @@ typedef void (*fcallback)(void*); //!< free()-like callback signature * @param str Pointer to a string. Will be replaced with the malloc()'ed string * @param initsize The initial size of the malloc()'ed string * @param fd A file descriptor to read from - * @return int Returns the size of the array on success, or -1 on error + * @retval (int)[-1, strlen(str)] Returns the size of the array on success, or -1 on error * @note The allocated buffer will expand and contract as necessary, but it's recommended to set `initsize` to some value close to or equal to the size of the file being read to reduce the number of resizes */ int rwbuf(char **str, unsigned long int initsize, int fd); @@ -73,7 +73,7 @@ int rwbuf(char **str, unsigned long int initsize, int fd); * @param fd The file descriptor to write to * @param buf The buffer to write from * @param len The length of the buffer - * @return int Returns 0 on success, -1 on error + * @retval (int)[-1, 0] Returns 0 on success, -1 on error */ int wwbuf(int fd, const unsigned char *buf, int len); @@ -83,7 +83,7 @@ int wwbuf(int fd, const unsigned char *buf, int len); * @brief `dirname()` reimplementation that returns a malloc()'ed string * * @param path The filepath to be inspected - * @return char* Returns a null-terminated string on success, or `null` on error + * @retval (char*)[NULL, char*] Returns a null-terminated string on success, or `null` on error */ char * vxdirname(const char * const path); @@ -107,7 +107,7 @@ typedef struct cl { * @param callbacks An array of free()-like callbacks. Must be `size` elements long * @param arguments An array of void pointers. Must be `size` elements long * @param size The number of elements the callbacks and arguments array are long - * @return int Returns 0 on success, -1 on error + * @retval (int)[-1, 0] Returns 0 on success, -1 on error */ int cleanup_init(cleanup *loc, fcallback callbacks[], void *arguments[], int size); @@ -117,7 +117,7 @@ int cleanup_init(cleanup *loc, fcallback callbacks[], void *arguments[], int siz * @param loc The cleanup object to modify * @param cb A free()-like callback to run * @param arg A piece of data for the callback to run - * @return int Returns 0 on success, -1 on error + * @retval (int)[-1, 0] Returns 0 on success, -1 on error */ int cleanup_register(cleanup *loc, fcallback cb, void *arg); @@ -128,7 +128,7 @@ int cleanup_register(cleanup *loc, fcallback cb, void *arg); * @param cb A free()-like callback to run * @param arg A piece of data for the callback to run * @param flag Whether or not the register should take place. Will not run if `flag` is non-zero - * @return int Returns 0 on success or skip, -1 on error + * @retval (int)[-1, 0] Returns 0 on success or skip, -1 on error */ int cleanup_cndregister(cleanup *loc, fcallback cb, void *arg, unsigned char flag); @@ -137,7 +137,7 @@ int cleanup_cndregister(cleanup *loc, fcallback cb, void *arg, unsigned char fla * @attention Does not free any registered callbacks or arguments, just marks them as available space * * @param loc The cleanup object to modify - * @return int Returns 0 on success, -1 on error + * @retval (int)[-1, 0] Returns 0 on success, -1 on error */ int cleanup_clear(cleanup *loc); @@ -145,7 +145,7 @@ int cleanup_clear(cleanup *loc); * @brief Fires all the registered callbacks and arguments in a cleanup object in FIFO (stack) order * * @param loc The cleanup object to fire - * @return int Returns 0 on success, -1 on error + * @retval (int)[-1, 0] Returns 0 on success, -1 on error */ int cleanup_fire(cleanup *loc); @@ -154,7 +154,7 @@ int cleanup_fire(cleanup *loc); * * @param loc The cleanup object in question * @param flag Whether the object should be fired. Will skip firing if non-zero - * @return int Returns 0 on success, -1 on error + * @retval (int)[-1, 0] Returns 0 on success, -1 on error */ int cleanup_cndfire(cleanup *loc, unsigned char flag); -- cgit v1.2.3