Esempio n. 1
0
/* Called for open tags <foo bar="baz"> */
static void
signal_parser_start_element (GMarkupParseContext *context,
                              const gchar         *element_name,
                              const gchar        **attribute_names,
                              const gchar        **attribute_values,
                              gpointer             user_data,
                              GError             **error)
{
    SignalParserData *data = user_data;
    if (data->type) {
        if (data->signal) {
            if (!strcmp (element_name, "return-type")) {
                get_type (&data->signal->return_type, element_name, attribute_names, attribute_values, error);
            } else if (!strcmp (element_name, "parameter")) {
                ++data->node->n_params;
                data->node->param_types = g_renew (SomeType, data->node->param_types, data->node->n_params);
                get_type (&data->node->param_types[data->node->n_params - 1],
                          element_name, attribute_names, attribute_values, error);
            }
        } else if (!strcmp (element_name, "signal")) {
            start_signal (context, element_name, attribute_names, attribute_values, user_data, error);
        }
    } else if (!strcmp (element_name, "object") ||
               !strcmp (element_name, "interface")) {
        start_object (context, element_name, attribute_names, attribute_values, user_data, error);
    }
}
Esempio n. 2
0
int	exec_course_branch_execute(t_node *root, t_global *global)
{
  int	pid;
  int	signal;
  int	status;

  if (is_builtin(root->content) != -1)
    {
      if ((exec_builtin(root, global)) == EXIT_FAILURE)
	return (EXIT_FAILURE);
      return (EXIT_SUCCESS);
    }
  if ((pid = fork()) == -1)
    return (EXIT_FAILURE);
  if (pid == 0)
    {
      start_signal();
      if ((status = exec_course_branch_select(root, global)) >= EXIT_FAILURE)
	return (status);
    }
  else
    {
      wait(&signal);
      exec_signal(WTERMSIG(signal));
      return((WEXITSTATUS(signal) == 0) ? EXIT_SUCCESS : EXIT_FAILURE);
    }
  return (EXIT_SUCCESS);
}
Esempio n. 3
0
static void init_program(int argc,char **argv)
{
  x11_init(argc,argv);

  if(sm->sologame)
    start_signal();
  else
  {
#ifdef USE_IPC
    int fd[2];

    setup_sigchild();
    if(pipe(fd) < 0)
    {
       perror("pipe"); exit(1);
    }

    if( (child_pids[0] = fork()) == 0)
    {
      close(fd[1]);
      if( (child_pids[1] = fork()) == 0)
      {
                        /* we use a pipe to check if the daddy is dead: */
        dup2(fd[0],0);  /* I'm no unix-guru, so if you know a better way, */
        close(fd[0]);   /* pls. let me know (perhaps with a processgroup */
        init_net(sm->hostname); /* <- should be neverending */
        exit(1);                /* <- but sure is sure :-) */
      }
      close(fd[0]);
      x11_cntrl();
      exit(1);
    }
    if(child_pids[0] < 0)
    {
      perror("fork");
      exit(1);
    }
    close(fd[0]);
#else
    if(init_net(sm->hostname) < 0)
    {
      fprintf(stderr,"nm: Networkproblems\n");
      exit(1);
    }
#endif

  }
}