list.h 388 B

12345678910111213141516171819202122232425
  1. #ifndef _LIST_H_
  2. #define _LIST_H_
  3. #include <lib.h>
  4. struct node
  5. {
  6. struct node * next;
  7. int val;
  8. };
  9. struct list
  10. {
  11. struct node * front;
  12. int len;
  13. };
  14. struct list * newlist(void);
  15. int listsert(struct list * l, int x);
  16. void listemove(struct list * l, int x);
  17. void listelete(struct list * l);
  18. int listearch(struct list * l, int x);
  19. int listpop(struct list * l);
  20. #endif /* _LIST_H_ */