Skip to content

Commit

Permalink
Fixed readme example.
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeDP committed Jul 5, 2019
1 parent f52d854 commit 95bb1c4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ Unsurprisingly, module is the core concept of libmodule architecture.
A module is an Actor that can listen on socket events too.
Frankly speaking, it is denoted by a MODULE() macro plus a bunch of mandatory callbacks, eg:
```
#include <module/module_easy.h>
#include <module/modules_easy.h>
#include <unistd.h>
#include <string.h>
#include <ctype.h>
MODULE("Pippo");
static void init(void) {
Expand Down Expand Up @@ -43,10 +49,12 @@ static void receive(const msg_t *msg, const void *userdata) {
switch (tolower(c)) {
case 'q':
m_log("Leaving...\n");
m_tell(self(), "ByeBye");
m_tell_str(self(), "ByeBye", false);
break;
default:
m_log("Pressed %c\n", c);
if (c != ' ' && c != '\n') {
m_log("Pressed %c\n", c);
}
break;
}
} else if (msg->pubsub_msg->type == USER &&
Expand Down

0 comments on commit 95bb1c4

Please sign in to comment.