Пример #1
0
int clients_new_from_fh(int fh, int proto, int byteorder, int update_nnode) {
 struct roar_client * c;
 int client;

 if ( fh == -1 )
  return -1;

 if ( proto != ROAR_PROTO_ROARAUDIO || byteorder != ROAR_BYTEORDER_NETWORK )
  return -1;

 if ( (client = clients_new()) == -1 )
  return -1;

 if ( clients_set_fh(client, fh) == -1 ) {
  clients_delete(client);
  return -1;
 }

 if ( update_nnode ) {
  if ( clients_get(client, &c) != -1 ) {
   if ( roar_nnode_free(&(c->nnode)) != -1 ) {
    roar_nnode_new_from_fh(&(c->nnode), fh, 1);
   }
  }
 }

 return 0;
}
Пример #2
0
int main(int argc, const char **argv)
{
  clients *c;

  c = clients_new(&watcher, &new_watcher_data, &reset_watcher_data);
  clients_add_arg(c, "path", 'P', "/yada", "parent path");
  clients_run(c, argc, argv);

  return 0;
}