Exemplo n.º 1
0
STATUS push_key_on_snapshot(char *key, snapshot *target_snapshot)
{
	entry *new_entry;
	STATUS get_new_entry_status = get_new_entry(key, &new_entry);
	if(get_new_entry_status != OK)
	{
		DEBUG("push_key_on_snapshot->get_new_entry_status !OK\n");
		return get_new_entry_status;
	}
	return push_entry_on_snapshot(new_entry, target_snapshot);
}
Exemplo n.º 2
0
STATUS append_key_to_entry_head(char *key, entry **new_entry_ptr)
{
	STATUS get_new_entry_status = get_new_entry(key, new_entry_ptr);
	if(get_new_entry_status != OK)
	{
		DEBUG("append_key_ton_entry_head->get_new_entry_status !OK\n");
		return get_new_entry_status;
	}
	DEBUG("append_key_ton_entry_head-> OK\n");
	return OK;
}
Exemplo n.º 3
0
STATUS restore_snapshot_by_snapshot(snapshot *target_snapshot, entry *entry_head)
{
	STATUS free_entries_status = free_entries_from_head(entry_head);
	if(free_entries_status != OK)
	{
		DEBUG("restore_snapshot_by_snapshot->free_entries_status !OK\n");
		return free_entries_status;
	}
	entry *snapshot_entry_cursor = target_snapshot->entries->next;
	entry *entry_head_cursor = entry_head->next;
	while(snapshot_entry_cursor)
	{
		STATUS get_new_entry_status = get_new_entry(snapshot_entry_cursor->key, &entry_head_cursor);
		if(get_new_entry_status != OK)
		{
			DEBUG("restore_snapshot_by_snapshot->get_new_entry_status !OK\n");
			return get_new_entry_status;
		}
		STATUS append_entry_status = push_entry_on_entry_head(entry_head_cursor, entry_head);
		if(append_entry_status != OK)
		{
			DEBUG("restore_snapshot_by_snapshot->append_entry_status !OK\n");
			return append_entry_status;
		}
		value *snapshot_value_cursor = snapshot_entry_cursor->values->next;
		value *value_head_cursor = entry_head_cursor->values->next;
		while(snapshot_value_cursor)
		{
			STATUS get_new_value_status = get_new_value(snapshot_value_cursor->value, &value_head_cursor);
			if(get_new_value_status != OK)
			{
				DEBUG("restore_snapshot_by_snapshot->get_new_value_status !OK\n");
				return get_new_value_status;
			}
			STATUS append_value_status = append_value_to_entry(value_head_cursor, entry_head_cursor);
			if(append_value_status != OK)
			{
				DEBUG("restore_snapshot_by_snapshot->append_value_status !OK\n");
				return append_value_status;
			}
			snapshot_value_cursor = snapshot_value_cursor->next;
		}
		snapshot_entry_cursor = snapshot_entry_cursor->next;
		entry_head_cursor = entry_head_cursor->next;
	}
	return OK;
}
Exemplo n.º 4
0
void	get_simple_chatarea(t_chatarea* args)
{
	args->ca_vbox = get_new_box(&args->ca_box_args);
	args->ca_topbox_args.box_parent.par_parent = args->ca_vbox;
	args->ca_topbox = get_new_box(&args->ca_topbox_args);
	args->ca_tv_args.tv_parent.par_parent = args->ca_topbox;
	args->ca_textarea = get_new_textview_scrolled(&args->ca_tv_args,
						      &args->ca_scroll);
	args->ca_trv_args.trv_parent.par_parent = args->ca_topbox;
	args->ca_treeview = get_new_treeview(&args->ca_trv_args);
	args->ca_botbox_args.box_parent.par_parent = args->ca_vbox;
	args->ca_botbox = get_new_box(&args->ca_botbox_args);
	args->ca_ent_args.ent_parent.par_parent = args->ca_botbox;
	args->ca_entry = get_new_entry(&args->ca_ent_args);
	args->ca_but_args.but_parent.par_parent = args->ca_botbox;
	args->ca_button = get_new_button(&args->ca_but_args);
}
Exemplo n.º 5
0
STATUS create_entry_if_not_exist(char *key, entry *entry_head)
{
	entry *entry_ptr = find_entry_by_key(key, entry_head);
	if(!entry_ptr)
	{
		STATUS get_new_entry_status = get_new_entry(key, &entry_ptr);
		if(get_new_entry_status != OK)
		{
			DEBUG("create_entry_if_not_exist->get_new_entry_status !OK\n");
			return get_new_entry_status;
		}
		STATUS append_entry_status = push_entry_on_entry_head(entry_ptr, entry_head);
		if(append_entry_status != OK)
		{
			DEBUG("create_entry_if_not_exist->append_entry_status !OK\n");
			return append_entry_status;
		}
	}
	DEBUG("create_entry_if_not_exist-> OK\n");
	return OK;
}