void exynos_param_unregister(struct exynos_camera *exynos_camera,
	struct exynos_param *param)
{
	struct list_head *list;

	if (exynos_camera == NULL || param == NULL)
		return;

	list = (struct list_head *) exynos_camera->params;
	while (list != NULL) {
		if ((void *) list == (void *) param) {
			list_head_remove(list);

			if ((void *) list == (void *) exynos_camera->params)
				exynos_camera->params = (struct exynos_param *) list->next;

			if (param->type == EXYNOS_PARAM_STRING && param->data.string != NULL)
				free(param->data.string);

			memset(param, 0, sizeof(struct exynos_param));
			free(param);

			break;
		}

list_continue:
		list = list->next;
	}
}
Beispiel #2
0
    bool bag::erase_one(const value_type& target) {
		node *target_ptr;
		target_ptr = list_search(head_ptr, target);
		if (target_ptr == NULL) {
			return false;
		}
		target_ptr->set_data( head_ptr->data( ) );
		list_head_remove(head_ptr);
		--many_nodes;
		return true;
    }
Beispiel #3
0
    bag::size_type bag::erase(const value_type& target) {
        size_type answer = 0;
        node *target_ptr;
        target_ptr = list_search(head_ptr, target);
        while (target_ptr != NULL) {
            target_ptr->set_data( head_ptr->data( ) );
            target_ptr = target_ptr->link( );
            target_ptr = list_search(target_ptr, target);
            list_head_remove(head_ptr);
			--many_nodes;
            ++answer;
        }
        return answer;
    }
Beispiel #4
0
void list_clear(node *&head_ptr)
{
    while (head_ptr != NULL)
        list_head_remove(head_ptr);
}
    void list_clear(node*& head_ptr)
    // Library facilities used: cstdlib
    {
	while (head_ptr != NULL)
	    list_head_remove(head_ptr);
    }