/*
    This file is part of Society Chess.
    Society Chess is a network chess game.
    Copyright (C) 2011  Sterling Pickens

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU 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 General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _POSIX_SOCKS_
#define _POSIX_SOCKS_ 1

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <pthread.h>
#include <math.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <errno.h>
#include <time.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <sys/wait.h>
#include <signal.h>
#include <netinet/in.h>
//#include "opengl.h"
#include "extern_globals.h"

extern int my_team_color;
extern int my_turn;
extern int check;
extern int op_check;
extern int checkmate;
extern int op_checkmate;
extern struct pieces my_pieces[16];
extern struct pieces oponent_pieces[16];
extern int saved_remote;
extern int IS_Server;
extern int Send_OK;

extern int errno;
extern int h_errno;
//char *my_ip_address;

extern char *Port;
extern char *Remote_IP;


void *Net_Recv(void *data);
void *Net_Send(void *data);

/*
void *get_in_addr(struct sockaddr *sa);
void get_in_addr_string(int sockfd, struct sockaddr *addr);
void sigchld_handler(int s);
void Process_Recv(char *buf);
void Process_Send(char *buf);
void *Next_Number(void *buf);
*/

//int Net_Connect(const char *ip, const char *port);
//int Net_Listen(const char *port);
//int Send_Message(int sockfd, const char *msg, int len);
//int Recv_Message(int sockfd, const char *msg, int len);
//int Grab_Remote_IP(int sockfd, struct sockaddr *theaddr);
//void *get_in_addr(struct sockaddr *sa);

#endif
