Exemplo n.º 1
0
t_bool	check_empty_cmd(t_lexem *elem)
{
  while (elem)
    {
      while ((elem) && (elem->type == STRING
			|| (t_dir(elem->type)) || elem->type == COL))
	elem = elem->right;
      if (!elem)
	return (CONTINUE);
      if (!((((elem->left && (elem->left->type == STRING
			      || ((t_dir(elem->left->type))
				  && elem->left->left
				  && elem->left->left->type == STRING))))
	     && (elem->right && (elem->right->type == STRING
				 || ((t_dir(elem->right->type))
				     && elem->right->right
				     && elem->right->right->type
				     == STRING))))))
	{
	  my_dprintf(2, "Invalid null command.\n");
	  return (FALSE);
	}
      elem = elem->right;
    }
  return (CONTINUE);
}
Exemplo n.º 2
0
void handle::reset() {

    if(!m_inputMapper)return;

    //needs an if statement for input types here
    if(m_inputMapper->getType() == "arcInput") {

        shared_ptr<arcInput> t_arc(static_pointer_cast <arcInput>(m_inputMapper)); //downcast it

        ofVec2f p;
        p.set(m_hook->getPosC());

        t_arc->setPosO(m_posC);
        t_arc->setBoundsDegrees(-90,90); //could be set in a variety of ways (a data structure will be needed)
        t_arc->setPivot(p);
        t_arc->reset();

    }

    if(m_inputMapper->getType() == "vecInput") {

        shared_ptr<vecInput> t_vec(static_pointer_cast <vecInput>(m_inputMapper));
        vector<ofVec2f> t_bounds;
        ofVec2f t_dir(m_posC - m_hook->getPosC());

        if(t_dir.length() > 0) {
            t_vec->setDirGlobal(t_dir.getNormalized());

            if(t_dir.length() < 100) { //this can become a parameter later
                t_bounds.push_back(m_hook->getPosC());
            } else {
                t_bounds.push_back(m_posC - t_vec->getDirGlobal() * 100);
            }

            t_bounds.push_back(m_posC + t_vec->getDirGlobal() * 100);

        } else {

            t_bounds.push_back(m_posC);
            t_bounds.push_back(m_posC + t_vec->getDirGlobal() * 100);
        }


        t_vec->setBounds(t_bounds[0], t_bounds[1]);
        t_vec->setPosO(m_posC);
        t_vec->reset();

    }

    if(m_inputMapper->getType() == "holdInput") {

        shared_ptr<holdInput> t_hold(static_pointer_cast <holdInput>(m_inputMapper)); //downcast it
        t_hold->setTime(5.0);
        t_hold->setIsPingPong(true);
        t_hold->setBounds(-1, 0.05);

    }

}
Exemplo n.º 3
0
void		manage_opt(t_all *files, t_option *option) {
  t_all		*cur;

  void (*tab[2])(t_dir (*begin), t_option (*option), int (total));
  tab[0] = &display_nol;
  tab[1] = &display_l;
  cur = files;
  while (cur != 0) {
    if(list_size(files) != 1 && cur->files != 0 && option->opt[3] == 0) {
      my_putstr(cur->path);
      my_putstr(":\n");
      tab[option->opt[0]](cur->files, option, cur->total);
      my_putstr("\n");
    }
    else
      tab[option->opt[0]](cur->files, option, cur->total);
    cur = cur->next;
  }
  if (option->opt[0] == 0)
    my_putstr("\n");
}