-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstream.h
44 lines (37 loc) · 1.14 KB
/
stream.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
#ifndef __DBIANCHI_STREAM__
#define __DBIANCHI_STREAM__
struct userPost {
char * username;
char * streamname;
char * date;
char * text;
};
typedef struct userPost userPost;
/**
* updateStream
* Adds post to stream and updates all relevant files
* IN: userPost * st
* OUT: None
* POST: Post is added to the stream
* ERROR: If the struct pointer (parameter) did not malloc correctly, and error may occur
**/
void updateStream(struct userPost *st);
/**
* addUser
* Adds a user to one or more streams (gives permission to post)
* IN: char *username, char *list
* OUT: None
* POST: User is given perssion to post to the specified streams
* ERROR: If the user does not enter the list of streams correctly, an error with strtok may occur
**/
void addUser(char *username, char *list);
/**
* removeUser
* Removes a user to one or more streams (gives permission to post)
* IN: char *username, char *list
* OUT: None
* POST: User is revoked perssion to post to the specified streams
* ERROR: If the user does not enter the list of streams correctly, an error with strtok may occur
**/
void removeUser(char *username, char *list);
#endif