Exemplo n.º 1
0
//no way to call a dynamic function name with a variable, so we're cheating =)
char *main_action_postage(PGconn *cnxn, int csock, char *str_uri_part, char *str_form_data, char *str_request, int int_request_len) {
  return
    // beware of prefixes! action_sequence will hit before action_sequences!
    // to fix, put the longer items first! E.g. action_sequences, then action_sequence
	
    //COPY csv action
    strncmp(str_uri_part, "action_copy", 12) == 0 ? action_copy(cnxn, str_form_data) :
	
    //PACKAGE
    strncmp(str_uri_part, "action_package_upload", 22) == 0 ? link_package_upload(str_request, int_request_len) :
    strncmp(str_uri_part, "action_package"       , 15) == 0 ? action_package     (str_form_data) :
	
    //FORK
    strncmp(str_uri_part, "action_upload", 14) == 0 ? link_postage_upload(str_request, int_request_len) :
    strncmp(str_uri_part, "action_file"  , 11) == 0 ? action_file        (str_form_data, str_uri_part, csock) :
    strncmp(str_uri_part, "action_fossil", 14) == 0 ? action_fossil      (str_form_data, str_request) :
	
	//data service
    strncmp(str_uri_part, "action_order" , 13) == 0 ? action_order (cnxn, str_form_data) :
    strncmp(str_uri_part, "action_select", 14) == 0 ? action_select(cnxn, csock, str_form_data) :
    strncmp(str_uri_part, "action_update", 14) == 0 ? action_update(cnxn, str_form_data) :
    strncmp(str_uri_part, "action_insert", 14) == 0 ? action_insert(cnxn, str_form_data) :
    strncmp(str_uri_part, "action_delete", 14) == 0 ? action_delete(cnxn, str_form_data) :
	
    // didn't find a match:
    cat_cstr("HTTP/1.1 500 Internal Server Error\r\n",
		"Content-Type: application/json; charset=UTF-8\r\n\r\n",
		"{\"stat\": false, \"dat\": {\"error\": \"Action does not exist.\"}}");
}
Exemplo n.º 2
0
static struct trace_tree *trace_tree_L(struct action *a)
{
	struct trace_tree_L *t = malloc(sizeof *t);
	t->h.type = TT_L;
	t->ac = action_copy(a);
	t->index = -1;
	return (struct trace_tree *)t;
}
Exemplo n.º 3
0
enum translation_state action_warn(struct translate *ts) {
  PRINT_DEBUG_FUNCTION_START("action_warn(*ts=%p)", ts);
  PRINT_DEBUG("unhandled opcode encountered in TU at %p: %s", ts->cur_instr,
              MEMDUMP(ts->cur_instr, ts->next_instr - ts->cur_instr));
  PRINT_DEBUG("Will try if it works to simply copy the instruction into the "
              "code cache, but something bad could happen now...");
  PRINT_DEBUG_FUNCTION_END("-> ???");
  return action_copy(ts);
}
Exemplo n.º 4
0
void vsx_widget_sequence_editor::action_cut()
{
  req(time_selection_active);
  action_copy();

  for (size_t i = 0; i < channels.size(); i++)
  {
    vsx_widget_sequence_channel& channel = *((vsx_widget_sequence_channel*)channels[i]);
    channel.clear_selection(time_selection_left, time_selection_right);
  }
}
Exemplo n.º 5
0
action_ref action_copy_list(action_ref actions) {
	if (!actions) return FAILURE; //no actions to copy

	action_ref cur_action = actions;
	action_ref result_actions = 0;

	while(cur_action) {
		if(result_actions == 0) {
			//First one, assign it now
			result_actions = action_copy(cur_action);
			if(!result_actions) return FAILURE;
			cur_action = cur_action->next_action;
			continue;
		}

		action_append_action(result_actions, action_copy(cur_action));
		cur_action = cur_action->next_action;
	}

	return result_actions;
}
Exemplo n.º 6
0
void vsx_widget_sequence_editor::command_process_back_queue(vsx_command_s *t) {
  // internal operations
  if (t->cmd == "seq_pool")
  {
    if (t->parts[1] == "del")
    {
      remove_master_channel_items_with_name(t->parts[2]);
    }
  } else
  if (t->cmd == "menu_close")
  {
    command_q_b.add_raw("delete_sequencer");
    parent->vsx_command_queue_b(this);
  } else
  if (t->cmd == "but_play")
  {
    command_q_b.add_raw("play");
    update_time_from_engine = true;
    parent->vsx_command_queue_b(this);
  }
  else
  if (t->cmd == "button_add_master")
  {
    ((dialog_query_string*)name_dialog)->show();
    return;
  }
  else
  if (t->cmd == "dialog_add")
  {
    command_q_b.add_raw("mseq_channel add " + t->parts[1]);
    parent->vsx_command_queue_b(this);
  }
  if (t->cmd == "but_set_loop_point")
  {
    ((dialog_query_string*)loop_point_dialog)->show();
    return;
  }

  if (t->cmd == "dialog_set_loop_point")
  {
    command_q_b.add_raw("time_set_loop_point " + t->parts[1]);
    parent->vsx_command_queue_b(this);
  }
  else
  if (t->cmd == "but_set_speed")
  {
    ((dialog_query_string*)speed_dialog)->show();
    return;
  }
  if (t->cmd == "dialog_set_speed")
  {
    command_q_b.add_raw("time_set_speed " + t->parts[1]);
    parent->vsx_command_queue_b(this);
  }

  if (t->cmd == "but_open_at_time")
  {
    channels_open_at_time();
    return;
  }

  if (t->cmd == "but_copy")
  {
    action_copy();
    return;
  }

  if (t->cmd == "but_paste")
  {
    action_paste();
    return;
  }

  if (t->cmd == "but_show_sequence_list")
  {
    sequence_list->show();
    sequence_group_list->hide();
  }

  if (t->cmd == "but_show_sequence_group_list")
  {
    sequence_list->hide();
    sequence_group_list->show();
  }


  if (t->cmd == "editor_action")
  {
    if (t->parts.size() == 3)
    {
      vsx_string<>deli = ":";
      vsx_nw_vector<vsx_string<> > parts;
      vsx_string_helper::explode(t->parts[2],deli, parts);
      if (parts[1] == "[master]")
      {
        backwards_message("mseq_channel remove " + parts[0] );
      }
      else
      {
        backwards_message("pseq_p remove " + parts[0] + " " + parts[1]);
      }
    }
  } else
  if (t->cmd == "remove_chan")
  {
    t->parse();
    bool run = true;
    channels_map.erase(t->parts[1]+":"+t->parts[2]);
    std::vector<vsx_widget*>::iterator it = channels.begin();
    while (run)
    {
      if (((vsx_widget_sequence_channel*)(*it))->channel_name == t->parts[1] && ((vsx_widget_sequence_channel*)(*it))->param_name == t->parts[2])
      {
        run = false;
        (*it)->_delete();
        channels.erase(it);
        interpolate_size();
      }
      else
      ++it;
    }
  } else
  if (t->cmd == "clear")
  {
    clear_sequencer();
  }
  else
  if (t->cmd == "seq_list_ok") {
    if (t->parts.size() > 1)
    {
      vsx_string<>deli = "&";
      vsx_nw_vector< vsx_string<> > parts;
      vsx_string_helper::explode(t->parts[1], deli, parts);
      std::map<vsx_string<>,vsx_string<> > sort_map;
      foreach(parts, i)
        sort_map[parts[i]] = parts[i];

      vsx_nw_vector< vsx_string<> > sorted_names;
      for (std::map<vsx_string<>,vsx_string<> >::iterator it = sort_map.begin(); it != sort_map.end(); it++)
        sorted_names.push_back((*it).second);

      deli = "\n";
      ((vsx_widget_sequence_tree*)sequence_list)->set_string(vsx_string_helper::implode(sorted_names,deli));
    } else ((vsx_widget_sequence_tree*)sequence_list)->set_string("[none defined]");
  } else

  if (t->cmd == "group_list_ok")
  {
    ((vsx_widget_sequence_group_tree*)sequence_group_list)->clear_groups();

    vsx_string<> data = t->parts[1];
    vsx_nw_vector< vsx_string<> > group_list;
    vsx_string_helper::explode_single(data, '|', group_list);
    foreach(group_list, i)
    {
      vsx_nw_vector< vsx_string<> > group_name_params;
      vsx_string_helper::explode_single(group_list[i], '+', group_name_params);
      groups[group_name_params[0]] = group_name_params[1];
      ((vsx_widget_sequence_group_tree*)sequence_group_list)->add_group(group_name_params[0]);

    }