Add some missing documentation. There is still some work to do.

This commit is contained in:
Enrico Fraccaroli
2022-12-09 11:35:30 -05:00
parent 8e1424fbec
commit de9daa4a85
8 changed files with 36 additions and 12 deletions
+2 -2
View File
@@ -463,7 +463,7 @@ EXTRACT_ALL = NO
# be included in the documentation.
# The default value is: NO.
EXTRACT_PRIVATE = NO
EXTRACT_PRIVATE = YES
# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual
# methods of a class will be included in the documentation.
@@ -481,7 +481,7 @@ EXTRACT_PACKAGE = NO
# included in the documentation.
# The default value is: NO.
EXTRACT_STATIC = NO
EXTRACT_STATIC = YES
# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
# locally in source files will be included in the documentation. If set to NO,
+4
View File
@@ -22,6 +22,8 @@
#define bitmask_check(V, M) ((V) & (M)) ///< Checks if the bits identified by the mask are all 1.
/// @brief Finds the first bit at zero, starting from the less significative bit.
/// @param value the value we need to analyze.
/// @return the position of the first zero bit.
static inline int find_first_zero(unsigned long value)
{
for (int i = 0; i < 32; ++i)
@@ -31,6 +33,8 @@ static inline int find_first_zero(unsigned long value)
}
/// @brief Finds the first bit not zero, starting from the less significative bit.
/// @param value the value we need to analyze.
/// @return the position of the first non-zero bit.
static inline int find_first_non_zero(unsigned long value)
{
for (int i = 0; i < 32; ++i)
+9 -8
View File
@@ -21,22 +21,23 @@ enum {
DT_WHT = 14
};
/// @brief Characters describing the direactory entry.
static const char dt_char_array[] = {
'?', // DT_UNKNOWN = 0,
'p', //DT_FIFO = 1,
'c', //DT_CHR = 2,
'p', // DT_FIFO = 1,
'c', // DT_CHR = 2,
'*',
'd', //DT_DIR = 4,
'd', // DT_DIR = 4,
'*',
'b', //DT_BLK = 6,
'b', // DT_BLK = 6,
'*',
'-', //DT_REG = 8,
'-', // DT_REG = 8,
'*',
'l', //DT_LNK = 10,
'l', // DT_LNK = 10,
'*',
's', //DT_SOCK = 12,
's', // DT_SOCK = 12,
'*',
'?', //DT_WHT = 14
'?', // DT_WHT = 14
};
/// Directory entry.
+2 -2
View File
@@ -8,8 +8,8 @@
#include "signal.h"
#include "stdio.h"
// Since there could be signal handlers listening for the abort, we
// need to keep track at which stage of the abort we are.
/// @brief Since there could be signal handlers listening for the abort, we need
/// to keep track at which stage of the abort we are.
static int stage = 0;
void abort(void)
+4
View File
@@ -14,6 +14,10 @@
static int __fd = -1;
/// @brief It parses the line (as string) and saves its content inside the
/// group_t structure.
/// @param grp the struct where we store the information.
/// @param buf the buffer from which we extract the information.
static inline void __parse_line(group_t *grp, char *buf)
{
assert(grp && "Received null grp!");
+7
View File
@@ -81,6 +81,13 @@ ssize_t __readline(int fd, char *buffer, size_t buflen)
return newline_len;
}
/// @brief Searches for the given entry inside the buffer.
/// @param fd the file descriptor of the file.
/// @param buffer the support buffer we use to read the file.
/// @param buflen the length of the support buffer.
/// @param name the username we are looking for.
/// @param uid the user-id of the user we are looking for.
/// @return the buffer itself if we have found the entry, NULL otherwise.
static inline char *__search_entry(int fd, char *buffer, int buflen, const char *name, uid_t uid)
{
while (__readline(fd, buffer, buflen)) {
+5
View File
@@ -13,6 +13,10 @@ char **environ;
static char **__environ = NULL;
static size_t __environ_size = 0;
/// @brief Finds the entry in the environ.
/// @param name the name of the entry we are looking for.
/// @param name_len the length of the name we received.
/// @return the index of the entry, or -1 if we did not find it.
static inline int __find_entry(const char *name, const size_t name_len)
{
if (environ) {
@@ -24,6 +28,7 @@ static inline int __find_entry(const char *name, const size_t name_len)
return -1;
}
/// @brief Makes a clone of the current environ.
static void __clone_environ()
{
if (environ) {
+3
View File
@@ -12,6 +12,9 @@
/// malloc(), calloc() or realloc().
#define MALLOC_MAGIC_NUMBER 0x600DC0DE
/// @brief Checks if the pointer is a valid malloc entry.
/// @param ptr the pointer we are checking.
/// @return 1 of success, 0 on failure.
static inline int __malloc_is_valid_ptr(void *ptr)
{
return (ptr && (((size_t *)ptr)[-1] == MALLOC_MAGIC_NUMBER));