Added getter functions.

This commit is contained in:
Nicolás Ortega Froysa
2017-11-18 10:59:00 +01:00
parent 5c5adbc109
commit c8964ad81a
2 changed files with 28 additions and 0 deletions

View File

@ -28,6 +28,8 @@ static std::uniform_int_distribution<dht::Value::Id> rand_id;
static std::map<time_t, int> sent_messages;
static std::string channel_list;
int NeoComm_join_channel(const char *channel_name) {
if(not node.isRunning())
{
@ -101,3 +103,14 @@ int NeoComm_leave_channel(const char *channel_name) {
channels.erase(s_chan_name);
return 1;
}
const char *NeoComm_get_channel_list() {
channel_list.clear();
for(auto &i : channels)
channel_list += i.first + " ";
return channel_list.c_str();
}
unsigned int NeoComm_get_num_channels() {
return channels.size();
}