Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
djthorpe committed Oct 24, 2023
1 parent 60ac6fb commit 5db72a2
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 2 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/doxygen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

name: Create documentation
on:
push:
branches: [ v2 ]
pull_request:
branches: [ v2 ]

jobs:
doxygen:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Doxygen Action
uses: mattnotmitt/[email protected]
with:
doxyfile-path: "./Doxyfile"
working-directory: "."

- name: Deploy documentation
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/html

7 changes: 5 additions & 2 deletions include/fuse/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ void fuse_panic(const char *expr, const char *file, int line);

#ifdef assert
#undef assert
#endif
#endif /* assert */

#ifdef DEBUG
#define assert(e) \
((void)((e) ? 0 : fuse_panic(#e, __FILE__, __LINE__)))
#else
#define assert(e) \
((void)((e) ? 0 : fuse_panic(#e, NULL, 0)))
#endif
#endif /* DEBUG */

#endif /* FUSE_DEBUG_H */
1 change: 1 addition & 0 deletions include/fuse/fuse.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ typedef struct fuse_instance fuse_t;

#include <fuse/debug.h>
#include <fuse/flags.h>
#include <fuse/list.h>
#include <fuse/pool.h>
#include <fuse/sleep.h>
#include <fuse/string.h>
Expand Down
65 changes: 65 additions & 0 deletions include/fuse/list.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/** @file list.h
* @brief Fuse linked list function prototypes
*
* This file contains the function prototypes for creating and destroying
* linked lists.
*/
#ifndef FUSE_LIST_H
#define FUSE_LIST_H
#include "fuse.h"

/** @brief Linked list defintion
*/
typedef struct fuse_list_instance fuse_list_t;

/** @brief Create a new empty linked list
* @param fuse The fuse application
* @returns A new empty linked list, or NULL if memory could not be allocated
*/
fuse_list_t *fuse_list_new(fuse_t *fuse);

/** @brief Deallocate a fuse linked list
*
* @param self The linked list to deallocate
*/
void fuse_list_destroy(fuse_list_t *self);

/** @brief Return the number of nodes in the list
*
* @param self The linked list
* @returns The number of nodes in the list
*/
void fuse_list_count(fuse_list_t *self);

/** @brief Return the next node in the list
*
* @param self The linked list
* @param ptr The current node, or NULL if the first node should be returned
* @returns The next node in the linked list, or NULL if there is no next node
*/
void *fuse_list_next(fuse_list_t *self, void *ptr);

/** @brief Return the previous node in the list
*
* @param self The linked list
* @param ptr The current node, or NULL if the last node should be returned
* @returns The previous node in the linked list, or NULL if there is no previous node
*/
void *fuse_list_prev(fuse_list_t *self, void *ptr);

/** @brief Add a node at the end of the list
*
* @param self The linked list
* @param ptr The new node to add to the end of the list
* @returns Returns true if successful, false otherwise
*/
void *fuse_list_push(fuse_list_t *self, void *ptr);

/** @brief Remove a node from the beginning of the list
*
* @param self The linked list
* @returns Returns the node removed from the beginning of the list, or NULL if the list is empty
*/
void *fuse_list_pop(fuse_list_t *self);

#endif // FUSE_LIST_H
27 changes: 27 additions & 0 deletions src/fuse/list.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/** @file list.h
* @brief Private function prototypes and structure definitions for linked lists
*/
#ifndef FUSE_PRIVATE_LIST_H
#define FUSE_PRIVATE_LIST_H

#include <fuse/fuse.h>

/* @brief Represents an instance of a fuse linked list
*/
struct fuse_list_instance
{
struct fuse_list_node *first; ///< The first node in the list, or NULL if the list is empty
struct fuse_list_node *last; ///< The last node in the list, or NULL if the list is empty
size_t count; ///< The number of nodes in the list
};

/* @brief Represents a node in a fuse linked list
*/
struct fuse_list_node
{
void *ptr; ///< The pointer to the node data
struct fuse_list_node *prev; ///< The previous node in the list, or NULL if this is the first node
struct fuse_list_node *next; ///< The next node in the list, or NULL if this is the last node
};

#endif

0 comments on commit 5db72a2

Please sign in to comment.