Skip to content

Commit d2446d7

Browse files
committed
Minor improvements to various documentation comments
1 parent e118f88 commit d2446d7

File tree

15 files changed

+106
-83
lines changed

15 files changed

+106
-83
lines changed

include/callstack.h

Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,22 @@ struct callstack {
6161
/**
6262
* @brief Creates a callstack of the calling function.
6363
*
64-
* The backtrace of the calling function is created.
65-
* The struct is allocated and needs to be freed using the function `callstack_delete(struct callstack *)`.
66-
* Returns `NULL` if an error occurs.
64+
* The backtrace of the calling function is created.<br>
65+
* The returned structure is allocated and needs to be freed using the function
66+
* @code callstack_delete(struct callstack *)@endcode.<br>
67+
* Returns @c NULL if an error occurs.
6768
*
6869
* @return A newly allocated callstack object.
6970
*/
7071
struct callstack * callstack_new(void);
7172

7273
/**
73-
* @brief Creates a new callstack object, ignoring all frames after the given address.
74+
* @brief Creates a new callstack object, ignoring all frames after the given
75+
* address.
7476
*
75-
* The struct is allocated and needs to be freed using the function `callstack_delete(struct callstack *)`.
76-
* Returns `NULL` if an error occurs.
77+
* The returned structure is allocated and needs to be freed using the function
78+
* @code callstack_delete(struct callstack *)@endcode.<br>
79+
* Returns @c NULL if an error occurs.
7780
*
7881
* @param address The stack address after which frames are ignored.
7982
* @return A newly allocated callstack object.
@@ -83,10 +86,12 @@ struct callstack * callstack_newWithAddress(void * address);
8386
/**
8487
* @brief Constructs the given callstack object.
8588
*
86-
* Stores the backtrace of the calling function.
87-
* The callstack object needs to be destructed using the function `callstack_destroy(struct callstack *)`
88-
* upon successful construction and use.
89-
* If an error occurs during the initialization of the given callstack object, `false` is returned.
89+
* Stores the backtrace of the calling function.<br>
90+
* The callstack object needs to be destructed using the function
91+
* @code callstack_destroy(struct callstack *)@endcode upon successful
92+
* construction and use.<br>
93+
* If an error occurs during the initialization of the given callstack object,
94+
* @c false is returned.
9095
*
9196
* @param self A pointer to the callstack object to be constructed.
9297
* @return Whether the given callstack object was constructed successfully.
@@ -96,9 +101,11 @@ bool callstack_emplace(struct callstack * self);
96101
/**
97102
* @brief Constructs the given callstack object.
98103
*
99-
* Stores the backtrace of the calling function, ignoring all frames after the given address.
100-
* The callstack object needs to be destructed using the function `callstack_destroy(struct callstack *)`
101-
* upon successful construction and use.
104+
* Stores the backtrace of the calling function, ignoring all frames after the
105+
* given address.<br>
106+
* The callstack object needs to be destructed using the function
107+
* @code callstack_destroy(struct callstack *)@endcode upon successful
108+
* construction and use.
102109
*
103110
* @param self A pointer to the callstack object to be constructed.
104111
* @param address The stack address after which frames are ignored.
@@ -109,12 +116,12 @@ bool callstack_emplaceWithAddress(struct callstack * self, void * address);
109116
/**
110117
* @brief Constructs the given callstack object.
111118
*
112-
* Copies the given callstack into the given object. If the trace is longer than
113-
* `CALLSTACK_BACKTRACE_SIZE`, only the first addresses are copied.
114-
* The callstack object needs to be destructed using the function `callstack_destroy(struct callstack *)`
115-
* after use.
116-
* If the given trace length is smaller than zero, `false` is returned and the given callstack
117-
* is not modified.
119+
* Copies the given callstack into the given object. If the trace is longer
120+
* than @c CALLSTACK_BACKTRACE_SIZE, only the first addresses are copied.<br>
121+
* The callstack object needs to be destructed using the function
122+
* @code callstack_destroy(struct callstack *)@endcode after use.<br>
123+
* If the given trace length is smaller than zero, @c false is returned and the
124+
* given callstack is not modified.
118125
*
119126
* @param self A pointer to the callstack object to be constructed.
120127
* @param trace The backtrace to be copied.
@@ -129,16 +136,16 @@ bool callstack_emplaceWithBacktrace(struct callstack * self,
129136
*
130137
* The given callstack is destroyed before the contents of the other one are copied.
131138
*
132-
* @param self A pointer to the the callstack to be replaced.
139+
* @param self A pointer to the callstack to be replaced.
133140
* @param other The callstack object to be copied.
134141
*/
135142
void callstack_copy(struct callstack * self, const struct callstack * other);
136143

137144
/**
138145
* @brief Translates the given callstack and returns an array of the translated frames.
139146
*
140-
* Returns `NULL` if an error happens.
141-
* Since version `1.1` a `callstack_frame` array is returned.
147+
* Returns @c NULL if an error happens.<br>
148+
* Since version @c 1.1 a @c callstack_frame array is returned.
142149
*
143150
* @param self The callstack object.
144151
* @return An array of translated callstack frames.
@@ -148,10 +155,10 @@ struct callstack_frame * callstack_toArray(struct callstack * self);
148155
/**
149156
* @brief Translates the given callstack and returns an array of the translated frames.
150157
*
151-
* If the given callstack has not been translated before, only the binary file information
152-
* is deducted.
153-
*
154-
* Returns `NULL` if an error happens.
158+
* If the given callstack has not been translated before, only the binary file
159+
* information is deducted.
160+
* <br><br>
161+
* Returns @c NULL if an error happens.
155162
*
156163
* @param self The callstack object.
157164
* @return An array of translated callstack frames.
@@ -163,14 +170,15 @@ struct callstack_frame * callstack_getBinaries(struct callstack * self);
163170
/**
164171
* @brief Translates the given callstack and returns an array of the translated frames.
165172
*
166-
* If the given has not been translated before, only the binary file information
167-
* is deducted.
168-
*
169-
* The deducted binary information is located in the cache of the library and becomes
170-
* invalid after a call to `callstack_clearCaches()` or after the callstack has
171-
* been translated entirely if `callstack_autoClearCaches` is `true`.
173+
* If the given has not been translated before, only the binary file
174+
* information is deducted.
172175
*
173-
* Returns `NULL` if an error happens.
176+
* The deducted binary information is located in the cache of the library and
177+
* becomes invalid after a call to @c callstack_clearCaches() or after the
178+
* callstack has been translated entirely if @c callstack_autoClearCaches is
179+
* @c true .
180+
* <br><br>
181+
* Returns @c NULL if an error happens.
174182
*
175183
* @param self the callstack object
176184
* @return an array of translated callstack frames

include/callstack_frame.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ struct callstack_frame {
7979
bool binaryFileIsSelf;
8080
/** The line number in the source file this frame is on. */
8181
unsigned long sourceLine;
82-
/** The line column number in the source file. */
82+
/** The line column number in the source file. */
8383
unsigned long sourceLineColumn;
8484
};
8585

@@ -107,7 +107,7 @@ static inline void callstack_frame_create(struct callstack_frame * self) {
107107
/**
108108
* Allocates a new and initialized callstack frame.
109109
*
110-
* @return the allocated callstack frame or `NULL` if unable to allocate
110+
* @return the allocated callstack frame or @c NULL if unable to allocate
111111
* @since v1.1
112112
*/
113113
static inline struct callstack_frame * callstack_frame_new(void) {
@@ -124,7 +124,7 @@ static inline struct callstack_frame * callstack_frame_new(void) {
124124
* Allocates a new callstack frame and deeply copies the given callstack frame.
125125
*
126126
* @param self the callstack frame to be copied
127-
* @return a copy of the given callstack frame or `NULL` if unable to allocate
127+
* @return a copy of the given callstack frame or @c NULL if unable to allocate
128128
* @since v1.1
129129
*/
130130
struct callstack_frame * callstack_frame_copy(const struct callstack_frame * self);
@@ -150,7 +150,8 @@ char * callstack_frame_getShortestName(const struct callstack_frame * self);
150150
/**
151151
* @brief Returns the shortest binary file name of the given callstack frame.
152152
*
153-
* If the given callstack frame does not have a binary file name the given fallback is returned.
153+
* If the given callstack frame does not have a binary file name the given
154+
* fallback is returned.
154155
*
155156
* @param self the callstack frame
156157
* @param fallback the fallback string to be returned
@@ -175,7 +176,8 @@ char * callstack_frame_getShortestSourceFile(const struct callstack_frame * self
175176
/**
176177
* @brief Returns the shortest source file name of the given callstack frame.
177178
*
178-
* If the given callstack frame does not have a source file name the given fallback is returned.
179+
* If the given callstack frame does not have a source file name the given
180+
* fallback is returned.
179181
*
180182
* @param self the callstack frame
181183
* @param fallback the fallback string to be returned

src/dlMapper/dlMapper.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ static bool dlMapper_inited = false;
3636
*
3737
* @param lhs the left-hand side value
3838
* @param rhs the right-hand side value
39-
* @return `0` if the two values compare equal or a value less than or greater than `0` according to the sorting order
39+
* @return @c 0 if the two values compare equal or a value less than or greater
40+
* than @c 0 according to the sorting order
4041
*/
4142
static inline int dlMapper_sortCompare(const void* lhs, const void* rhs) {
4243
const struct loadedLibInfo* a = lhs,
@@ -63,11 +64,13 @@ bool dlMapper_init(void) {
6364
/**
6465
* @brief Returns how the given key compares to the given loaded library info.
6566
*
66-
* The given key is the searched address, the given element is a loaded library info object.
67+
* The given key is the searched address, the given element is a loaded library
68+
* info object.
6769
*
6870
* @param key the searched key
6971
* @param element the element to be checked
70-
* @return `0` if the key is in the loaded library or a value smaller or greater than `0` according to the sorting order
72+
* @return @c 0 if the key is in the loaded library or a value smaller or
73+
* greater than @c 0 according to the sorting order
7174
*/
7275
static inline int dlMapper_searchCompare(const void* key, const void* element) {
7376
// IMPORTANT: key is the searched address, element the array element

src/dlMapper/dlMapper.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* CallstackLibrary - Library creating human-readable call stacks.
33
*
4-
* Copyright (C) 2024 mhahnFr
4+
* Copyright (C) 2024 - 2025 mhahnFr
55
*
66
* This file is part of the CallstackLibrary.
77
*
@@ -30,7 +30,7 @@
3030
* @brief Initializes the dlMapper.
3131
*
3232
* Does nothing if it has already been initialized; if that is the case,
33-
* `true` will be returned.
33+
* @c true will be returned.
3434
*
3535
* @return whether the dlMapper has been successfully initialized
3636
*/
@@ -47,15 +47,16 @@ bool dlMapper_isInited(void);
4747
* Returns the loaded library info the given pointer is associated with.
4848
*
4949
* @param address the address whose runtime image to find
50-
* @return the associated loaded library info object or `NULL` if not in any loaded library
50+
* @return the associated loaded library info object or @c NULL if not in any
51+
* loaded library
5152
*/
5253
struct loadedLibInfo* dlMapper_libInfoForAddress(const void* address);
5354

5455
/**
5556
* Returns the runtime image info for the runtime image of the given name.
5657
*
5758
* @param fileName the file name of the runtime image
58-
* @return the associated runtime image info or `NULL` if not found
59+
* @return the associated runtime image info or @c NULL if not found
5960
*/
6061
struct loadedLibInfo* dlMapper_libInfoForFileName(const char* fileName);
6162

src/functionInfo/functionInfo.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@
2727
#include "../dlMapper/dlMapper.h"
2828

2929
/**
30-
* Fills the given function info structure using the given loaded runtime image info.
30+
* Fills the given function info structure using the given loaded runtime image
31+
* info.
3132
*
3233
* @param info the runtime image info to be examined
3334
* @param functionName the name of the function to be found
3435
* @param functionInfo the function info structure to be filled
35-
* @return whether the structure was filled, e. g. whether the function was found in the runtime image
36+
* @return whether the structure was filled, e.g. whether the function was
37+
* found in the runtime image
3638
*/
3739
static inline bool functionInfo_getFrom(struct loadedLibInfo* info,
3840
const char* functionName,

src/parser/demangling/cxx/demangler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ extern "C" {
2929
/**
3030
* @brief Demangles the given name.
3131
*
32-
* If the given name is demangled, the given string is not freed.
32+
* If the given name is demangled, the given string is not freed.<br>
3333
* If the name has not been demangled, the given string is returned.
3434
*
3535
* @param name The name to be demangled.
36-
* @return The demangled name or the given name, if it could not be demangled.
36+
* @return the demangled name or the given name, if it could not be demangled
3737
*/
3838
char* callstack_demangle_cxx(char* name);
3939

src/parser/demangling/demangler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
/**
2626
* @brief Attempts to demangle the given name.
2727
*
28-
* Currently Swift and C++ demangling is supported.
28+
* Currently, Swift and C++ demangling is supported.
2929
*
3030
* @param name the name to be demangled
3131
* @return an allocated demangled name or the input if not mangled

src/parser/file/dwarf/dwarf_lineInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
/**
3030
* @brief This structure represents a source file reference.
3131
*
32-
* Unavailable fields are set to `0` and `NULL`, respectively.
32+
* Unavailable fields are set to @c 0 and @c NULL, respectively.
3333
*/
3434
struct dwarf_sourceFile {
3535
/** The allocated source file name. */

src/parser/file/dwarf/v4/parser.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,14 @@ static inline bool dwarf4_parseLineProgramHeader(struct dwarf_parser* self, size
7979
}
8080

8181
/**
82-
* Constructs the full file name for the given file name entry using the given include directories.
82+
* Constructs the full file name for the given file name entry using the given
83+
* include directories.
8384
*
8485
* @param file the file name entry whose full path to construct
8586
* @param directories the included directories
8687
* @param defaultDirectory the compilation directory
87-
* @return an allocated full path string of the given file or `NULL` if the allocation failed or the main source file was referred
88+
* @return an allocated full path string of the given file or @c NULL if the
89+
* allocation failed or the main source file was referred
8890
*/
8991
static inline char* dwarf4_stringFrom(const struct dwarf_fileNameEntry* file,
9092
const struct vector_string* directories,
@@ -116,7 +118,8 @@ static inline char* dwarf4_stringFrom(const struct dwarf_fileNameEntry* file,
116118
/**
117119
* Constructs a file reference for the given file index.
118120
*
119-
* @param self the generified parser object, the specific part for version 4 and earlier is used
121+
* @param self the generified parser object, the specific part for version 4
122+
* and earlier is used
120123
* @param file the index of the desired file
121124
* @return the source file reference
122125
*/

src/parser/file/dwarf/v5/fileAttribute.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* CallstackLibrary - Library creating human-readable call stacks.
33
*
4-
* Copyright (C) 2024 mhahnFr
4+
* Copyright (C) 2024 - 2025 mhahnFr
55
*
66
* This file is part of the CallstackLibrary.
77
*
@@ -27,7 +27,7 @@
2727
/**
2828
* @brief This structure represents a DWARF 5 file attribute.
2929
*
30-
* Unavailable fields are set to `0` and `NULL`, respectively.
30+
* Unavailable fields are set to @c 0 and @c NULL, respectively.
3131
*/
3232
struct fileAttribute {
3333
/** The path name. */

0 commit comments

Comments
 (0)