Skip to content

Commit

Permalink
parcall: command for clear parallel call groups (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
cspiel1 authored Jan 9, 2025
1 parent fd0f171 commit 5518949
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions modules/parcall/parcall.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,25 @@ static int cmd_rmpar(struct re_printf *pf, void *arg)
}


/**
* Clear list of parallel call groups
*
* @param pf Print handler
* @param arg not used
*
* @return 0 if success, otherwise errorcode
*/
static int cmd_clrpar(struct re_printf *pf, void *arg)
{
(void)arg;

hash_flush(d.pargroups);
(void)re_hprintf(pf, "parcall: cleared parallel call groups\n");

return 0;
}


/**
* Add a parallel call target to a group
*
Expand Down Expand Up @@ -515,6 +534,7 @@ static int cmd_pardebug(struct re_printf *pf, void *arg)
static const struct cmd cmdv[] = {
{"mkpar", 0,CMD_PRM, "Create parallel call group", cmd_mkpar },
{"rmpar", 0,CMD_PRM, "Remove parallel call group", cmd_rmpar },
{"clrpar", 0, 0, "Clear parallel call groups", cmd_clrpar },
{"paradd", 0,CMD_PRM, "Add a call target to a group", cmd_paradd },
{"parcall", 0,CMD_PRM, "Initiate parallel call to given group",
cmd_parcall },
Expand Down

0 comments on commit 5518949

Please sign in to comment.