Commit e69037ef authored by Arnaud Lefebvre's avatar Arnaud Lefebvre

Upload New File

parent 663e5113
Pipeline #10052 passed with stage
in 0 seconds
#ifndef fonctions_h
#define fonctions_h
typedef struct node {
uint64_t value;
struct node *next;
} node_t;
typedef struct list {
node_t *first;
node_t *last;
int length;
} list_t;
typedef struct node2 {
list_t *diviseurs;
struct node2 *next;
} node_lst;
typedef struct list2 {
node_lst *first;
node_lst *last;
int length;
} list_lst;
typedef struct buffer1 {
list_t *numbers;
sem_t free;
sem_t full;
pthread_mutex_t mutex;
bool can_stop;
} buffer1;
typedef struct buffer2 {
list_lst *prime_numbers;
sem_t free;
sem_t full;
pthread_mutex_t mutex;
} buffer2;
void init_list_t(list_t *my_list);
void init_list_lst(list_lst *my_list);
void put_node_t(list_t *my_list, uint64_t value);
void put_node_lst(list_lst *my_list, list_t *put_list);
uint64_t get_node_t(list_t *my_list);
list_t *get_node_lst(list_lst *my_list);
void clear_list_t(list_t *my_list);
list_t *prime_list(uint64_t value);
int count_lines(char *filename);
buffer1 *init_buffer_1(int nthreads);
buffer2 *init_buffer_2(int nthreads);
#endif //fonctions_h
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment