-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwf_repo.h
More file actions
41 lines (31 loc) · 896 Bytes
/
Copy pathwf_repo.h
File metadata and controls
41 lines (31 loc) · 896 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
#ifndef WF_REPO_H
#define WF_REPO_H
#include <pthread.h>
#include "wf_table.h"
/* Pre-Analysis Stage stack */
typedef struct wf_repo{
int size; // number of items in the Stack
wf_table* table;
pthread_mutex_t lock;
} wf_repo;
/**
* Creates and initalizes a synchronized stack (WRD repo)
* Returns NULL as error
*/
wf_repo* wf_repo_create();
/** for the purpose of clearing the stack at the end of analysis */
int wf_repo_clear(wf_repo *);
/**
* RETURN: EXIT_SUCCESS when deleting empty wf_repo,
* EXIT_FAILURE if non-empty stack passed (will not delete if not empty)
*/
int wf_repo_destroy(wf_repo*);
/** RETURN: 0 if stack empty, 1 otherwise.
* */
int wf_repo_empty(wf_repo *);
/* Please check this */
void wf_repo_push(wf_repo*, wf_table* table);
/** RETURN: Item on top of stack, or NULL if stack empty.
* */
wf_table* wf_repo_pop(wf_repo*);
#endif