diff options
| author | @syxhe <https://t.me/syxhe> | 2025-06-11 19:39:52 -0500 |
|---|---|---|
| committer | @syxhe <https://t.me/syxhe> | 2025-06-11 19:39:52 -0500 |
| commit | 1536f1e0287b8281014200ef6911b294272c4773 (patch) | |
| tree | 4ba6faa9e7c30b8a6641189e98423a7a927f6d32 /src/shared.h | |
| parent | 28487272fdad654b72c843e04384953e6fbb806f (diff) | |
Start fixing the encryption scheme
Diffstat (limited to 'src/shared.h')
| -rw-r--r-- | src/shared.h | 18 |
1 files changed, 9 insertions, 9 deletions
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 | |||
| 62 | * @param str Pointer to a string. Will be replaced with the malloc()'ed string | 62 | * @param str Pointer to a string. Will be replaced with the malloc()'ed string |
| 63 | * @param initsize The initial size of the malloc()'ed string | 63 | * @param initsize The initial size of the malloc()'ed string |
| 64 | * @param fd A file descriptor to read from | 64 | * @param fd A file descriptor to read from |
| 65 | * @return int Returns the size of the array on success, or -1 on error | 65 | * @retval (int)[-1, strlen(str)] Returns the size of the array on success, or -1 on error |
| 66 | * @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 | 66 | * @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 |
| 67 | */ | 67 | */ |
| 68 | int rwbuf(char **str, unsigned long int initsize, int fd); | 68 | int rwbuf(char **str, unsigned long int initsize, int fd); |
| @@ -73,7 +73,7 @@ int rwbuf(char **str, unsigned long int initsize, int fd); | |||
| 73 | * @param fd The file descriptor to write to | 73 | * @param fd The file descriptor to write to |
| 74 | * @param buf The buffer to write from | 74 | * @param buf The buffer to write from |
| 75 | * @param len The length of the buffer | 75 | * @param len The length of the buffer |
| 76 | * @return int Returns 0 on success, -1 on error | 76 | * @retval (int)[-1, 0] Returns 0 on success, -1 on error |
| 77 | */ | 77 | */ |
| 78 | int wwbuf(int fd, const unsigned char *buf, int len); | 78 | int wwbuf(int fd, const unsigned char *buf, int len); |
| 79 | 79 | ||
| @@ -83,7 +83,7 @@ int wwbuf(int fd, const unsigned char *buf, int len); | |||
| 83 | * @brief `dirname()` reimplementation that returns a malloc()'ed string | 83 | * @brief `dirname()` reimplementation that returns a malloc()'ed string |
| 84 | * | 84 | * |
| 85 | * @param path The filepath to be inspected | 85 | * @param path The filepath to be inspected |
| 86 | * @return char* Returns a null-terminated string on success, or `null` on error | 86 | * @retval (char*)[NULL, char*] Returns a null-terminated string on success, or `null` on error |
| 87 | */ | 87 | */ |
| 88 | char * vxdirname(const char * const path); | 88 | char * vxdirname(const char * const path); |
| 89 | 89 | ||
| @@ -107,7 +107,7 @@ typedef struct cl { | |||
| 107 | * @param callbacks An array of free()-like callbacks. Must be `size` elements long | 107 | * @param callbacks An array of free()-like callbacks. Must be `size` elements long |
| 108 | * @param arguments An array of void pointers. Must be `size` elements long | 108 | * @param arguments An array of void pointers. Must be `size` elements long |
| 109 | * @param size The number of elements the callbacks and arguments array are long | 109 | * @param size The number of elements the callbacks and arguments array are long |
| 110 | * @return int Returns 0 on success, -1 on error | 110 | * @retval (int)[-1, 0] Returns 0 on success, -1 on error |
| 111 | */ | 111 | */ |
| 112 | int cleanup_init(cleanup *loc, fcallback callbacks[], void *arguments[], int size); | 112 | int cleanup_init(cleanup *loc, fcallback callbacks[], void *arguments[], int size); |
| 113 | 113 | ||
| @@ -117,7 +117,7 @@ int cleanup_init(cleanup *loc, fcallback callbacks[], void *arguments[], int siz | |||
| 117 | * @param loc The cleanup object to modify | 117 | * @param loc The cleanup object to modify |
| 118 | * @param cb A free()-like callback to run | 118 | * @param cb A free()-like callback to run |
| 119 | * @param arg A piece of data for the callback to run | 119 | * @param arg A piece of data for the callback to run |
| 120 | * @return int Returns 0 on success, -1 on error | 120 | * @retval (int)[-1, 0] Returns 0 on success, -1 on error |
| 121 | */ | 121 | */ |
| 122 | int cleanup_register(cleanup *loc, fcallback cb, void *arg); | 122 | int cleanup_register(cleanup *loc, fcallback cb, void *arg); |
| 123 | 123 | ||
| @@ -128,7 +128,7 @@ int cleanup_register(cleanup *loc, fcallback cb, void *arg); | |||
| 128 | * @param cb A free()-like callback to run | 128 | * @param cb A free()-like callback to run |
| 129 | * @param arg A piece of data for the callback to run | 129 | * @param arg A piece of data for the callback to run |
| 130 | * @param flag Whether or not the register should take place. Will not run if `flag` is non-zero | 130 | * @param flag Whether or not the register should take place. Will not run if `flag` is non-zero |
| 131 | * @return int Returns 0 on success or skip, -1 on error | 131 | * @retval (int)[-1, 0] Returns 0 on success or skip, -1 on error |
| 132 | */ | 132 | */ |
| 133 | int cleanup_cndregister(cleanup *loc, fcallback cb, void *arg, unsigned char flag); | 133 | int cleanup_cndregister(cleanup *loc, fcallback cb, void *arg, unsigned char flag); |
| 134 | 134 | ||
| @@ -137,7 +137,7 @@ int cleanup_cndregister(cleanup *loc, fcallback cb, void *arg, unsigned char fla | |||
| 137 | * @attention Does not free any registered callbacks or arguments, just marks them as available space | 137 | * @attention Does not free any registered callbacks or arguments, just marks them as available space |
| 138 | * | 138 | * |
| 139 | * @param loc The cleanup object to modify | 139 | * @param loc The cleanup object to modify |
| 140 | * @return int Returns 0 on success, -1 on error | 140 | * @retval (int)[-1, 0] Returns 0 on success, -1 on error |
| 141 | */ | 141 | */ |
| 142 | int cleanup_clear(cleanup *loc); | 142 | int cleanup_clear(cleanup *loc); |
| 143 | 143 | ||
| @@ -145,7 +145,7 @@ int cleanup_clear(cleanup *loc); | |||
| 145 | * @brief Fires all the registered callbacks and arguments in a cleanup object in FIFO (stack) order | 145 | * @brief Fires all the registered callbacks and arguments in a cleanup object in FIFO (stack) order |
| 146 | * | 146 | * |
| 147 | * @param loc The cleanup object to fire | 147 | * @param loc The cleanup object to fire |
| 148 | * @return int Returns 0 on success, -1 on error | 148 | * @retval (int)[-1, 0] Returns 0 on success, -1 on error |
| 149 | */ | 149 | */ |
| 150 | int cleanup_fire(cleanup *loc); | 150 | int cleanup_fire(cleanup *loc); |
| 151 | 151 | ||
| @@ -154,7 +154,7 @@ int cleanup_fire(cleanup *loc); | |||
| 154 | * | 154 | * |
| 155 | * @param loc The cleanup object in question | 155 | * @param loc The cleanup object in question |
| 156 | * @param flag Whether the object should be fired. Will skip firing if non-zero | 156 | * @param flag Whether the object should be fired. Will skip firing if non-zero |
| 157 | * @return int Returns 0 on success, -1 on error | 157 | * @retval (int)[-1, 0] Returns 0 on success, -1 on error |
| 158 | */ | 158 | */ |
| 159 | int cleanup_cndfire(cleanup *loc, unsigned char flag); | 159 | int cleanup_cndfire(cleanup *loc, unsigned char flag); |
| 160 | 160 | ||
