#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <signal.h>

#define LABELSIZE 64
#define DEBUG 0

#define VERSION "NetGL v0.06"

typedef unsigned long hash_t;
typedef unsigned long unique_t;

struct color_t {
        double r;
        double g;
        double b;
};

struct vert_t {
	double x;
	double y;
	double z;
	struct color_t col;
};

struct packet_t {
	struct vert_t src;
	struct vert_t dst;
	unsigned int life;
	void *rmap; /* Reverse Map for List Head */
};

struct point_t {
	struct vert_t vertex;
	void *rmap; /* Reverse Map for List Head */
	char label[LABELSIZE];
	unsigned int life;
	int type;
	unique_t ip;
	hash_t hash;
};

/* Types of Point */
enum { POINT = 0x01, LABEL = 0x02, TEXT = 0x04 };

/* External Functions */
extern int packet_handling_child(int pkp, int rp);
extern int graphics_handling_child(int pkp, int pop, int argc, char **argv);
extern int point_handling_child(int pop, int rp);
extern void niptov(struct vert_t *v, u_int32_t ip);
extern void aiptov(struct vert_t *v, char *ip);

extern void *xmalloc(size_t size);
