API for checking if an annotation is a reference or function variable.#17386
Conversation
| * Return: Nothing. | ||
| */ | ||
| R_API void r_annotation_free(void *e, void *user); | ||
| /** |
There was a problem hiding this comment.
Please don't invent your own documentation comment style. If you use doxygen style comments do so consistently. They are not only for human reading but also consumption by tools. See the documentation https://www.doxygen.nl/manual/index.html
There was a problem hiding this comment.
Radare2 uses this style https://www.kernel.org/doc/html/v4.16/doc-guide/kernel-doc.html#how-to-format-kernel-doc-comments
I have been told to use this and all functions in r_annotated_code.h are documented using this style.
There was a problem hiding this comment.
There was a problem hiding this comment.
Is it written anywhere r2 documentation that it uses this style? If it I am fine with that, but I haven't seen it used anywhere except r_annotated_code.
There was a problem hiding this comment.
This https://github.com/radareorg/radare2/blob/master/DEVELOPERS.md claims that r2 uses doxygen C-style comments.
There was a problem hiding this comment.
@ITAYC0HEN @thestr4ng3r I'm not sure when this was decided. See this comment by @ITAYC0HEN #16939 (review) It was discussed when I was working on #16939 .
| } | ||
| } | ||
|
|
||
| R_API bool is_annotation_reference(RCodeAnnotation *annotation) { |
There was a problem hiding this comment.
Please consider renaming these functions. Most R_API functions use common prefix, this helps avoiding naming conflict and improves discoverability. Maybe r_annotation_is_reference and r_annotation_is_variable.
There was a problem hiding this comment.
I will rename them.
There was a problem hiding this comment.
@karliss I have renamed functions. If you are fine with the code now, please merge it. I think PR #2352 Cutter can get merged tonight. Since it uses the new API implemented in this PR, I want this to get merged first.
I will send a separate PR with documentation using Doxygen tonight, but I think it can be another PR as it could take more time to review.
| R_API bool r_annotation_is_reference(RCodeAnnotation *annotation); | ||
| /** | ||
| * r_annotation_is_variable() - Checks if the specified annotation is a function variable. | ||
| * @annotation: Pointer to an annotation. |
There was a problem hiding this comment.
shouldn't it be @param annotation ?
There was a problem hiding this comment.
This is how it is (if I understand correctly) in kernel-docs https://www.kernel.org/doc/html/v4.16/doc-guide/kernel-doc.html#how-to-format-kernel-doc-comments
| */ | ||
| R_API bool r_annotation_is_reference(RCodeAnnotation *annotation); | ||
| /** | ||
| * r_annotation_is_variable() - Checks if the specified annotation is a function variable. |
There was a problem hiding this comment.
Should you include the name of the function in the docs? "r_annotation_is_variable() "? Also, if you include this, the signature is wrong as it receive parameters
There was a problem hiding this comment.
This is how it is in Kernel-doc, if I understand correctly. As I said, I'm going to update this to Doxygen, in another PR. So let's not worry about documentation for now.
ITAYC0HEN
left a comment
There was a problem hiding this comment.
Please make sure to fix the docs in the upcoming pr.
|
Here's the new PR fixing the documentation: #17397 |
…edCode (#17429) * Annotation for function name (#17204) * Annotations for Constant Variables and Global Variables for the decompiler (#17281) * Annotation For Function Variables (#17375) * function variable annotation added (includes local variable and function parameter) * API for checking if an annotation is a reference or function variable. (#17386) * Update docs in annotate code API (#17397) * Unit tests for annotated code API (#17403)
…edCode (radareorg#17429) * Annotation for function name (radareorg#17204) * Annotations for Constant Variables and Global Variables for the decompiler (radareorg#17281) * Annotation For Function Variables (radareorg#17375) * function variable annotation added (includes local variable and function parameter) * API for checking if an annotation is a reference or function variable. (radareorg#17386) * Update docs in annotate code API (radareorg#17397) * Unit tests for annotated code API (radareorg#17403)
…edCode (#17429) * Annotation for function name (#17204) * Annotations for Constant Variables and Global Variables for the decompiler (#17281) * Annotation For Function Variables (#17375) * function variable annotation added (includes local variable and function parameter) * API for checking if an annotation is a reference or function variable. (#17386) * Update docs in annotate code API (#17397) * Unit tests for annotated code API (#17403)
Your checklist for this pull request
Detailed description
This PR implements the following two functions. Read the documentation below.
...
Test plan
...
Closing issues
...