fixed comments to get rid of doxygen warnings

This commit is contained in:
prozessorkern
2020-04-01 19:16:11 +02:00
parent 785d73306d
commit 6c76dfc7ae
7 changed files with 85 additions and 56 deletions

View File

@@ -327,7 +327,7 @@ shellmatta_retCode_t shellmatta_removeCmd(shellmatta_handle_t handle, shellmatta
* @param[in] handle shellmatta instance handle
* @param[in] mode insert mode of the shellmatta type #shellmatta_mode_t
* @param[in] echoEnabled true: echo received chars to the output
* @param[in] delimiter delimiter used to detect the end of a cmd (default \r)
* @param[in] delimiter delimiter used to detect the end of a cmd (default "\r")
* @return errorcode #SHELLMATTA_OK
* #SHELLMATTA_USE_FAULT (param err)
*/
@@ -443,13 +443,13 @@ shellmatta_retCode_t shellmatta_processData(shellmatta_handle_t handle,
if(0u == inst->hereLength)
{
/**
* \dot
* @dot
* digraph heredocParser {
* start -> wait [ label="<< in first line - store delimiter" ];
* wait -> wait [ label="delimiter not detected" ];
* wait -> end [ label="delimiter found - remove all heredoc stuff and send the input to the command" ];
* }
* \enddot */
* @enddot */
/** -# check for heredoc - add string delimiter to stop strstr from searching too far */
inst->buffer[inst->inputCount] = '\0';

View File

@@ -44,11 +44,11 @@ shellmatta_retCode_t escape_processArrowKeys(shellmatta_instance_t *inst)
history_storeCmd(inst);
if(false == inst->historyReadUp)
{
history_navigate(inst, -1);
(void)history_navigate(inst, -1);
}
inst->historyReadUp = true;
history_restoreCmd(inst);
history_navigate(inst, -1);
(void)history_navigate(inst, -1);
break;
case 'B': /* arrow down */
@@ -58,10 +58,10 @@ shellmatta_retCode_t escape_processArrowKeys(shellmatta_instance_t *inst)
history_storeCmd(inst);
if(true == inst->historyReadUp)
{
history_navigate(inst, 1);
(void)history_navigate(inst, 1);
}
inst->historyReadUp = false;
history_navigate(inst, 1);
(void)history_navigate(inst, 1);
history_restoreCmd(inst);
}
break;

View File

@@ -59,7 +59,7 @@ static void appendHistoryByte(shellmatta_instance_t *inst, char byte)
* @brief reads a byte from the history buffer and decreases the read index
* @param[in] inst pointer to a shellmatta instance
* @param[out] byte pointer to a char where the read out byte will be stored
* @return
* @return false: no new byte to read
*/
static bool getHistoryByte(shellmatta_instance_t *inst, char *byte)
{
@@ -84,6 +84,12 @@ static bool getHistoryByte(shellmatta_instance_t *inst, char *byte)
return ret;
}
/**
* @brief navigates in the history buffer by the given number of commands
* @param[in, out] inst pointer to a shellmatta instance
* @param[in] cnt direction and count to navigate
* @return false: end of buffer reached
*/
bool history_navigate(shellmatta_instance_t *inst, int32_t cnt)
{
bool ret = true;
@@ -185,13 +191,6 @@ void history_storeCmd(shellmatta_instance_t *inst)
inst->dirty = false;
}
/**
* @brief navigates in the history buffer by the given number of commands
* @param[in] inst pointer to a shellmatta instance
* @param[in] cnt direction and count to navigate
* @return
*/
/**
* @brief restores the command from the history buffer where the read
* index points on
@@ -224,7 +223,7 @@ void history_restoreCmd(shellmatta_instance_t *inst)
utils_writeEcho(inst, inst->buffer, inst->inputCount);
inst->dirty = false;
}
history_navigate(inst, 1);
(void)history_navigate(inst, 1);
}
/**

View File

@@ -116,7 +116,7 @@ static char peekNextHunk(shellmatta_instance_t *inst)
/**
* @brief tries to parse the current input hunk and check if this is a configured option
* @param[in] handle shellmatta handle
* @param[in] inst pointer to shellmatta instance
* @param[in] optionString option string e.g. "cd:e::"
* @param[out] option pointer to store the detected option to
* @param[out] argtype pointer to var of type #shellmatta_opt_argtype_t != NULL
@@ -178,7 +178,7 @@ static shellmatta_retCode_t parseShortOpt( shellmatta_instance_t *inst,
/**
* @brief tries to parse the current input hunk and check if this is a configured option
* @param[in] handle shellmatta handle
* @param[in] inst pointer to shellmatta instance
* @param[in] longOptions option structure - pointer to array of type #shellmatta_opt_long_t
* @param[out] option pointer to store the detected option to
* @param[out] argtype pointer to var of type #shellmatta_opt_argtype_t != NULL

View File

@@ -294,7 +294,7 @@ static shellmatta_retCode_t helpCmdFct(shellmatta_handle_t handle, const char *a
/** -# loop through all commands to determine the lengths of each cmd */
while(NULL != cmd)
{
maxCmdLen = SHELLMATTA_MAX(maxCmdLen, strlen(cmd->cmd));
maxCmdLen = SHELLMATTA_MAX(maxCmdLen, strlen(cmd->cmd));
if(NULL != cmd->cmdAlias)
{
maxCmdAliasLen = SHELLMATTA_MAX(maxCmdAliasLen, strlen(cmd->cmdAlias));

View File

@@ -22,9 +22,26 @@
#include "shellmatta.h"
#include <stdint.h>
/* some helper macros */
/**
* @brief returns the minimum of a and b
* @param[in] a parameter a
* @param[in] b parameter b
*/
#define SHELLMATTA_MIN(a,b) (((a) > (b)) ? (b) : (a))
/**
* @brief returns the maximum of a and b
* @param[in] a parameter a
* @param[in] b parameter b
*/
#define SHELLMATTA_MAX(a,b) (((a) < (b)) ? (b) : (a))
/**
* @brief calls fct with cnt bytes from buffer (to print cnt same bytes)
* @param[in] buffer buffer to send (shall contain the same char)
* @param[in] cnt count of bytes to send
* @param[in] fct write function
*/
#define SHELLMATTA_PRINT_BUFFER(buffer,cnt,fct) \
while((cnt) > sizeof((buffer))) \
{ \
@@ -36,11 +53,13 @@
(fct)((buffer), (cnt)); \
}
/** @brief help command which prints all shellmatta commands as table */
extern const shellmatta_cmd_t helpCmd;
/** @brief magic used to check if a shellmatta instance is initiated */
#define SHELLMATTA_MAGIC 0x5101E110u
/** \brief overwritable output buffer size */
/** @brief overwritable output buffer size */
#ifndef SHELLMATTA_OUTPUT_BUFFER_SIZE
#define SHELLMATTA_OUTPUT_BUFFER_SIZE 128u
#endif