summaryrefslogtreecommitdiffstats
path: root/libcnary/iterator.c
blob: f4897f9d89eb9bbb1f80d1ac3f04193ea4925d84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
 * iterator.c
 *
 *  Created on: Mar 8, 2011
 *      Author: posixninja
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "list.h"
#include "object.h"
#include "iterator.h"

void iterator_destroy(iterator_t* iterator) {
	if(iterator) {
		free(iterator);
	}
}

iterator_t* iterator_create(list_t* list) {
	iterator_t* iterator = (iterator_t*) malloc(sizeof(iterator_t));
	if(iterator == NULL) {
		return NULL;
	}
	memset(iterator, '\0', sizeof(iterator_t));

	if(list != NULL) {
		// Create and bind to list

	} else {
		// Empty Iterator
	}

	return iterator;
}

object_t* iterator_next(iterator_t* iterator) {
	return NULL;
}

int iterator_bind(iterator_t* iterator, list_t* list) {
	return -1;
}