Archived
3
0
This repository has been archived on 2024-06-18. You can view files and clone it, but cannot push or open issues or pull requests.
libipc-old/core-test/app/array_proc.c
2018-10-08 16:15:35 +02:00

35 lines
738 B
C

#include "../../core/client.h"
#include <string.h> /* memset */
#include <stdio.h>
int main()
{
int ret;
struct ipc_clients clients;
memset(&clients, 0, sizeof(struct ipc_clients));
struct ipc_client client_tab[5];
memset(&client_tab, 0, sizeof(struct ipc_client) * 5);
int i;
for (i = 0; i < 5; i++) {
client_tab[i].proc_fd = i;
ret = ipc_client_add(&clients, &client_tab[i]);
if (ret == -1) {
printf("erreur realloc\n");
}
}
ipc_clients_print(&clients);
ret = ipc_client_del(&clients, &client_tab[2]);
if(ret < 0) {
printf("erreur %d\n", ret );
}
ipc_clients_print(&clients);
ipc_clients_free (&clients);
return 0;
}