new list stuff (still in work)
[my-code/api.git] / list / list.h
index c500c1a..467e751 100644 (file)
@@ -2,16 +2,25 @@
 
 #include <stdio.h>
 
-
-#define SINGLE 'S'
-#define DOUBLE 'D'
+#define L_SUCCESS 1
+#define L_ERROR -1
+#define L_NO_NEXT_ELEMENT -2
+#define L_NO_SUCH_ELEMENT -3
+#define L_INVALID_ELEMENT -4
+#define L_EMPTY_LIST -5
 
 typedef struct s_list_element {
-       struct s_list_element *next;
-       void *data;
-       int number;
+  struct s_list_element *next;
+  void *data;
+  int data_len;
+  int number;
 } t_list_element;
 
 typedef struct s_list {
-       t_list_element start;
+  t_list_element *start;
+  t_list_element *current;
 } t_list;
+
+/* function prototypes */
+int list_init(t_list *list);
+