more abstraction in network.* and input.*, first display stuff in ivac.*
[my-code/ivac.git] / src / ivac.h
index 9e171bd..a4365f4 100644 (file)
@@ -7,15 +7,58 @@
 #define _GNU_SOURCE
 #include <stdio.h>
 
+#include "network.h"
+#include "event.h"
+#include "input.h"
+
 /* defines */
 #define CHAR_USERNAME 32
+#define ERROR -1
+#define SUCCESS 1
+
+#define IVAC_LISTEN_PORT 1025
+
+#define IVAC_S_SEC 2
+#define IVAC_S_USEC 500
+
+#define IVAC_SEND_NAME 'n'
+#define IVAC_SEND_G_CAP 'g'
+#define IVAC_SEND_AV_CAP 'c'
+
+#define NETWORK (1<<0)
+
+#define AUDIO (1<<0)
+#define VIDEO (1<<1)
+#define DUPLEX (1<<2)
+
+#define COLUMN 80
+#define LINE 24
 
 /* variables */
+typedef struct s_challenger {
+  char name[CHAR_USERNAME];
+  unsigned char g_cap;
+  unsigned short av_cap;
+} t_challenger;
 
-typedef s_ivac {
+typedef struct s_ivac {
   char username[CHAR_USERNAME];
+  unsigned char g_cap;
+  unsigned short av_cap;
   t_net net;
-  
+  t_event event;
+  t_input input;
+  t_challenger challenger[MAX_CONNECTIONS];
 } t_ivac;
 
+/* function prototypes */
+int ivac_send_info(int channel,t_ivac *ivac);
+int ivac_receive_info(int channel,t_ivac *ivac);
+int ivac_event_cb(t_event *event,void *ptr);
+int ivac_regular_cb(t_event *event,void *ptr);
+int ivac_parse_command(t_input *input,void *ptr);
+int ivac_display_head(void);
+int ivac_display_prompt(t_ivac *ivac);
+int ivac_display(t_ivac *ivac);
+
 #endif