Skip to content

Commit 9496821

Browse files
committed
Add documentation for the laco_dispatch function
1 parent 4bbda9e commit 9496821

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/commands.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ struct LacoCommand {
1010
LacoHandler handler;
1111
};
1212

13+
/**
14+
* Goes through each instance from the list of commands and see if there is
15+
* a match with for command_keyword. When there is a match, the defined
16+
* handler inside the LacoCommand gets called -- passing in LacoState and
17+
* the arguments. The list of commands expects the last entry of the array
18+
* to be `{ NULL, NULL }` for ease of iteration.
19+
*/
1320
void laco_dispatch(const struct LacoCommand* commands,
1421
struct LacoState* laco, const char* command_keyword,
1522
const char** arguments);

0 commit comments

Comments
 (0)