Skip to content
Extraits de code Groupes Projets
Valider 1b3644f1 rédigé par Arnaud Lefebvre's avatar Arnaud Lefebvre
Parcourir les fichiers

Upload New File

parent f0f2b35f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Pipeline #7347 réussi
#ifndef fonctions_h
#define fonctions_h
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <unistd.h>
#include <getopt.h>
#include <pthread.h>
#include <semaphore.h>
typedef struct node {
int value;
struct node *next;
} node_t;
typedef struct list {
node_t *first;
node_t *last;
int length;
} list_t;
typedef struct node2 {
list_t *lst;
struct node2 *next;
} node_lst;
typedef struct list2 {
node_lst *first;
node_lst *last;
int length;
} list_lst;
typedef struct buffer1 {
list_t *numbers;
pthread_mutex_t mutex;
sem_t free;
sem_t full;
int length;
} buf1;
typedef struct buffer2 {
list_lst *prime_numbers;
pthread_mutex_t mutex;
sem_t free;
sem_t full;
int length;
} buf2;
void include_node_t(list_t *my_list, int val);
void include_node_lst(list_lst *my_list_list, list_t *my_list);
int value_at_index(list_t *my_list, int index);
int remove_node_t(list_t *my_list);
list_t *remove_list_t(list_lst *my_list);
void clear_list_t(list_t *my_list);
void clear_list_lst(list_lst *my_list);
int is_div(int chiffre, int div);
int is_prime(int chiffre);
list_t *prime_list(int chiffre);
buf1 *init_buffer_1(int NTHREADS);
buf2 *init_buffer_2(int NTHREADS);
int count_lines(char *filename);
#endif /* fonctions_h */
\ No newline at end of file
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter