Advertisement
Guest User

LinkedList.h

a guest
Oct 28th, 2012
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.85 KB | None | 0 0
  1. /**
  2. * @file LinkedList.h
  3. * @author Davidthefat
  4. * @date 10/27/12
  5. * @version 1.0
  6. */
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #ifndef LINKEDLIST_H
  10. #define LINKEDLIST_H
  11. typedef struct node {
  12.         void *data;
  13.         struct node *next;
  14. } Node;
  15. typedef struct LinkedList {
  16.         Node *head, *tail, *iterator;
  17.         int size;
  18.         void *(*get)(int index);
  19.         void (*add)(void *in, int index);
  20.         void (*addEnd)(void *in);
  21.         void (*addBeg)(void *in);
  22.         void (*addN)(void*in, int index);
  23.         char (*del)(int index);
  24.         void (*set)(void *in, int index);
  25.         void (*destruct)(void);
  26. } LList;
  27. LList *self;
  28.  
  29. LList *construct();
  30. void *get(int index);
  31. void add(void *in, int index);
  32. void addEnd(void *in);
  33. void addBeg(void *in);
  34. char del(int index);
  35. void set(void *in, int index);
  36. void destruct();
  37. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement