Skip to content

Commit

Permalink
Add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnicola committed Apr 3, 2020
1 parent 5df7141 commit 61801a4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions misc/plugutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,18 @@ post_error (const char *oid, struct script_infos *desc, int port,
proto_post_error (oid, desc, port, "tcp", action);
}

/**
* @brief Get the a plugins preference.
*
* Search in the preferences set by the client. If it is not
* present, search in redis cache for the default.
*
* @param[in] oid Script OID to get the preference from
* @param[in] name Name of the preference to get
* @param[in] pref_id Id of the preferences to get
*
* @return script preference on success, Null otherwise.
**/
char *
get_plugin_preference (const char *oid, const char *name, int pref_id)
{
Expand Down
10 changes: 10 additions & 0 deletions nasl/nasl_scanner_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,16 @@ script_add_preference (lex_ctxt *lexic)
return FAKE_CELL;
}

/**
* @brief Get a preferences of the current script.
*
* Search the preference by preference name or by preferences id.
*
* @param[in] lexic NASL lexer.
*
* @return lex cell containing the preferences value as a string.
* Fake cell otherwise
*/
tree_cell *
script_get_preference (lex_ctxt *lexic)
{
Expand Down

0 comments on commit 61801a4

Please sign in to comment.