Exemplo n.º 1
0
void func_aset(func_t *f, int i, func_t *g)
{
  if(f==NULL){ FUNC_ERROR_ARG2("func_aset",f,g); }
  if(i<0 || i>=func_asize(f)){ printf("Error in func_aset(%s,%d,%s)\n",func_op(f),i,func_op(g)); exit(0); }
  f->a[i]=func_del(f->a[i]);
  f->a[i]=g;
}
Exemplo n.º 2
0
/*
** Returns the command
*/
char			*get_next_command(const int fd)
{
  char			buffer[10];
  struct termios	backup_st;
  void			(*func_op)();
  int			r;

  cursor(0);
  command_line(malloc(sizeof(*(command_line(NULL))) * 10));
  command_line(NULL)[0] = 0;
  backup_st = get_next_init(retrieve_vars(NULL));
  display_line(retrieve_vars(NULL));
  func_op = NULL;
  while (func_op != key_enter && (r = read(fd, buffer, 9)))
    {
      buffer[r] = 0;
      func_op = get_input_modif(buffer);
      func_op ? func_op() :
	command_line(insert_string(command_line(NULL), buffer));
      display_line(retrieve_vars(NULL));
    }
  set_conf(backup_st, 0);
  signal(SIGWINCH, SIG_DFL);
  signal(SIGTSTP, SIG_DFL);
  my_putchar('\n');
  test_and_add_bindkey(command_line(NULL));
  return (command_line(NULL));
}
Exemplo n.º 3
0
func_t *func_def_any_eval(func_t *f)
{
  int i;
  func_t *g=NULL,*x=NULL;
  g=func_scope_find(0,func_op(f));
  if(func_is_def(g) && func_aget(g,0)!=NULL){
    g=FR(func_aget(g,0));
    if(func_asize(f)>0){
      x=func_list(func_asize(f));
      for(i=0; i<func_asize(f); i++){ func_aset(x,i,FR(func_aget(f,i))); }
      g=func_maps(g,0,FR(x));
    }
    f=func_del(f);
  }else{ g=f; }
  x=func_del(x);
  return g;
}
int asm_mips_operand_fetch(asm_operand *op, u_char *opcode, int otype,
                                          asm_instr *ins)

{ 
  vector_t      *vec;
  u_int         dim[1];
  int           ret;
  int           (*func_op)(asm_operand *op, u_char *opcode, int otype, asm_instr *ins);
  
  vec = aspect_vector_get(LIBASM_VECTOR_OPERAND_MIPS);
  dim[0] = otype;
  
  func_op = aspect_vectors_select(vec, dim);
  if ( (ret = func_op(op, opcode, otype, ins)) == -1) {
    printf("%s:%i Unsupported operand content : %i\n", __FILE__, __LINE__, 
    	     otype);
  }

  return (ret);
}
Exemplo n.º 5
0
void func_adel(func_t *f, int i)
{
  if(f==NULL){ FUNC_ERROR_ARG1("func_adel",f); }
  if(i<0 || i>=func_asize(f)){ printf("Error in func_adel(%s,%d)\n",func_op(f),i); exit(0); }
  f->a[i]=func_del(f->a[i]);
}
Exemplo n.º 6
0
func_t *func_aget(func_t *f, int i)
{
  if(f==NULL || f->a==NULL){ FUNC_ERROR_ARG1("func_aget",f); }
  if(i<0 || i>=func_asize(f)){ printf("Error in func_aget(%s,%d)\n",func_op(f),i); exit(0); }
  return f->a[i];
}