2021-06-08 20:15:47 +02:00
|
|
|
//=-------------------------------------------------------------------------=//
|
2021-06-09 14:40:23 +02:00
|
|
|
// base definition //
|
2021-06-08 20:15:47 +02:00
|
|
|
// //
|
2021-10-13 09:44:00 +02:00
|
|
|
// Copyright © 2021 Libre en Communs (contact@a-lec.org) //
|
|
|
|
// Copyright © 2021 Adrien Bourmault (neox@a-lec.org) //
|
2021-06-08 20:15:47 +02:00
|
|
|
// //
|
|
|
|
// This file is part of gem-graph. //
|
|
|
|
// //
|
|
|
|
// This program is free software: you can redistribute it and/or modify //
|
|
|
|
// it under the terms of the GNU Affero General Public License as //
|
|
|
|
// published by the Free Software Foundation, either version 3 of the //
|
|
|
|
// License, or (at your option) any later version. //
|
|
|
|
// //
|
|
|
|
// This program is distributed in the hope that it will be useful, //
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
|
|
// GNU Affero General Public License for more details. //
|
|
|
|
// //
|
|
|
|
// You should have received a copy of the GNU Affero General Public License //
|
|
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>. //
|
|
|
|
//=-------------------------------------------------------------------------=//
|
|
|
|
|
2021-06-16 19:44:48 +02:00
|
|
|
#include <sys/param.h>
|
2021-06-08 20:15:47 +02:00
|
|
|
#include <stdbool.h>
|
2021-06-09 14:40:23 +02:00
|
|
|
#include <pthread.h>
|
2024-03-13 19:10:10 +01:00
|
|
|
#include <assert.h>
|
2021-06-09 14:40:23 +02:00
|
|
|
#include <unistd.h>
|
|
|
|
#include <malloc.h>
|
2021-06-11 15:11:06 +02:00
|
|
|
#include <string.h>
|
2021-06-11 17:39:34 +02:00
|
|
|
#include <stdlib.h>
|
2021-06-16 19:44:48 +02:00
|
|
|
#include <errno.h>
|
|
|
|
#include <stdio.h>
|
2021-07-09 20:34:32 +02:00
|
|
|
#include <netinet/in.h>
|
2021-06-09 14:40:23 +02:00
|
|
|
|
|
|
|
#define BASE_H
|
2021-06-08 20:15:47 +02:00
|
|
|
|
2021-07-14 00:41:21 +02:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
|
2024-03-13 19:10:10 +01:00
|
|
|
#define LOGMSG "<%s:%s()>"
|
|
|
|
#define printlog(FORMAT, ...) printf("\e[0m" LOGMSG " " FORMAT "\e[0m", \
|
|
|
|
__FILE__,__func__, ##__VA_ARGS__)
|
|
|
|
#define printerr(FORMAT,...) fprintf(stderr, "\e[0m" LOGMSG " " FORMAT "\e[0m",\
|
|
|
|
__FILE__,__func__, ##__VA_ARGS__)
|
2021-07-14 00:41:21 +02:00
|
|
|
#define LEN(x) (sizeof(x) / sizeof((x)[0]))
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
|
2024-03-13 19:10:10 +01:00
|
|
|
struct parameters_t
|
|
|
|
{
|
|
|
|
char *configDir;
|
|
|
|
char *userDir;
|
|
|
|
char *modelDir;
|
|
|
|
};
|
2021-06-16 13:06:23 +02:00
|
|
|
|
2024-03-13 19:10:10 +01:00
|
|
|
/*
|
|
|
|
* Structure describing an arrow
|
|
|
|
*/
|
|
|
|
struct arrow_t {
|
|
|
|
uint load;
|
|
|
|
uint site;
|
|
|
|
uint x;
|
|
|
|
uint y;
|
|
|
|
uint z;
|
|
|
|
};
|