-
Notifications
You must be signed in to change notification settings - Fork 0
/
tweet.h
48 lines (35 loc) · 1020 Bytes
/
tweet.h
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
46
47
48
#ifndef _LIST_H_DEF_
#define _LIST_H_DEF_
/*************************
** Datatype definitions **
**************************/
typedef struct node
{
char *tweet;
struct node *next;
struct node *prev;
} node;
typedef struct list
{
int size;
struct node *head;
} list;
/** Creates a new, empty list **/
list *makeList();
/** Creates a new node with the given tweet **/
node *makeNode(char *tweet);
/** Adds a tweet to the given list **/
void addTweet(list *list, node *node);
/** Prints all tweets from the list **/
void printTweets(list *list);
/** Prints one tweet**/
void printTweet(node *node);
/** Converts a list to the string with a <?> token separating items **/
char *listToStr(list *list);
/** Returns a copied version of the given list **/
list *copyList(list *list);
/** Frees the memory allocated to the given list **/
void freeList(list *list);
/** Compares two lists. Returns 0 if they are different, 1 if they are the same **/
int listsEqual(list *list1, list *list2);
#endif