<commit_before>/*
** Author(s):
**  - <NAME> <<EMAIL>>
**
** Copyright (C) 2010 Aldebaran Robotics
*/

#include <qi/qi.h>
#include <stdio.h>


void branle(const char *signature, qi_message_t *params, qi_message_t *ret, void *data)
{
  printf("paf la branle!\n");
}

int main(int argc, char **argv)
{
  char *result;

  qi_client_t *client = qi_client_create("simplecli");
  qi_client_connect(client, argv[1]);
  //qi_message_t *message = qi_message_create();
  //qi_message_t *ret = qi_message_create();

//  qi_message_write_string(message, "master.locateService::s:ss");
//  qi_message_write_string(message, "master.listServices::{ss}:");
//  qi_message_write_string()
//  qi_client_call(client, "master.locateService::s:ss", message, ret);

  //result = qi_master_locate_service(client, "master.locateService::s:ss");

  //result = qi_message_read_string(ret);
  printf("locate returned: %s\n", result);


  qi_server_t *server = qi_server_create("serv");
  qi_server_connect(server, argv[1]);
  qi_server_advertise_service(server, "bande:::", &branle, 0);
  sleep(1);

  qi_message_t *message = qi_message_create();
  qi_message_t *ret = qi_message_create();

  qi_message_write_string(message, "bande:::");
//  qi_message_write_string(message, "master.listServices::{ss}:");
//  qi_message_write_string()
  qi_client_call(client, "bande:::", message, ret);

  sleep(1);
  return 0;
}

<commit_msg>test_c_bindings: usage and basic argument errors handling<commit_after>/*
** Author(s):
**  - <NAME> <<EMAIL>>
**
** Copyright (C) 2010, 2011 Aldebaran Robotics
*/

#include <qi/qi.h>
#include <stdio.h>


void brandade(const char *signature, qi_message_t *params, qi_message_t *ret, void *data)
{
  printf("paf la brandade!\n");
}

void usage() {
  printf("usage: test_c_bindings address:port\n");
  exit(1);
}

int main(int argc, char **argv)
{
  char *result;

  if (argc <= 1)
    usage();
  qi_client_t *client = qi_client_create("simplecli");
  qi_client_connect(client, argv[1]);
  //qi_message_t *message = qi_message_create();
  //qi_message_t *ret = qi_message_create();

//  qi_message_write_string(message, "master.locateService::s:ss");
//  qi_message_write_string(message, "master.listServices::{ss}:");
//  qi_message_write_string()
//  qi_client_call(client, "master.locateService::s:ss", message, ret);

  //result = qi_master_locate_service(client, "master.locateService::s:ss");

  //result = qi_message_read_string(ret);
  printf("locate returned: %s\n", result);


  qi_server_t *server = qi_server_create("serv");
  qi_server_connect(server, argv[1]);
  qi_server_advertise_service(server, "brandade:::", &brandade, 0);
  sleep(1);

  qi_message_t *message = qi_message_create();
  qi_message_t *ret = qi_message_create();

  qi_message_write_string(message, "brandade:::");
//  qi_message_write_string(message, "master.listServices::{ss}:");
//  qi_message_write_string()
  qi_client_call(client, "brandade:::", message, ret);

  sleep(1);
  return 0;
}


{'fraction_non_alphanumeric': 0.1705270224907687, 'fraction_numerical': 0.00872776099362202, 'mean_word_length': 5.696629213483146, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4924333', 'n_tokens_mistral': 1191, 'n_tokens_neox': 1119, 'n_words': 197}