Want more features on Pastebin? Sign Up, it's FREE!
Guest

LinkedList.h

By: a guest on Oct 28th, 2012  |  syntax: C  |  size: 0.85 KB  |  views: 36  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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
clone this paste RAW Paste Data