X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=examples%2Fchat.c;h=5d06538c3915a8a943ecfa7c2fde23a090513fa0;hb=d1d09fadfe04b30d5275021524092341cb0c58c8;hp=bf3170916fbfe1c9e4cdb9633b78a91a5543065a;hpb=8582c3b5e0ee3f6b547dbaed7a1214819d3dfc91;p=meshlink-tiny diff --git a/examples/chat.c b/examples/chat.c index bf31709..5d06538 100644 --- a/examples/chat.c +++ b/examples/chat.c @@ -41,9 +41,6 @@ static void node_status(meshlink_handle_t *mesh, meshlink_node_t *node, bool rea } } -static meshlink_node_t **nodes; -static size_t nnodes; - static void parse_command(meshlink_handle_t *mesh, char *buf) { char *arg = strchr(buf, ' '); @@ -69,30 +66,6 @@ static void parse_command(meshlink_handle_t *mesh, char *buf) { fprintf(stderr, "Could not restart MeshLink: %s\n", meshlink_strerror(meshlink_errno)); exit(1); } - } else if(!strcasecmp(buf, "who")) { - if(!arg) { - nodes = meshlink_get_all_nodes(mesh, nodes, &nnodes); - - if(!nnodes) { - fprintf(stderr, "Could not get list of nodes: %s\n", meshlink_strerror(meshlink_errno)); - } else { - printf("%zu known nodes:", nnodes); - - for(size_t i = 0; i < nnodes; i++) { - printf(" %s", nodes[i]->name); - } - - printf("\n"); - } - } else { - meshlink_node_t *node = meshlink_get_node(mesh, arg); - - if(!node) { - fprintf(stderr, "Error looking up '%s': %s\n", arg, meshlink_strerror(meshlink_errno)); - } else { - printf("Node %s found\n", arg); - } - } } else if(!strcasecmp(buf, "quit")) { printf("Bye!\n"); fclose(stdin);