-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshowcase_util.h
More file actions
43 lines (30 loc) · 766 Bytes
/
showcase_util.h
File metadata and controls
43 lines (30 loc) · 766 Bytes
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
#ifndef SHOWCASE_UTIL_H
#define SHOWCASE_UTIL_H
#include "lib.h"
typedef struct {
int id;
char author[30];
char password[30];
char object[100];
char text[3800];
time_t date;
} post;
typedef struct showcase_node{
post element;
struct showcase_node* next;
} showcase;
showcase* bacheca;
sem_t* semaphore;
//add new post into the showcase
int insert_post(char author[], char object[], char text[], char password[]);
//delete post from showcase
char* delete_post(int id, char password[], char username[]);
//print the showcase
void print_showcase();
//check if the showcase is empty
int empty_showcase();
//make a wait on the semaphore
void semaphore_wait();
//make a post on the semaphore
void semaphore_post();
#endif