server.h 762 Bytes
#ifndef __SERVER_H__
#define __SERVER_H__

#include <stdio.h>      /* for printf() and fprintf() */
#include <sys/select.h> /* for select system call and related */

#include "client.h"

typedef struct {
    int            servSock;
    tClient        clients[FD_SETSIZE];
    unsigned int   maxFd;
    fd_set         socks;
    char           logPath[512];
    char           namePat[512];
    FILE         * wHandle;
} tVirtualItemServer;


void serverClose(tVirtualItemServer *);
void serverShutdown(tVirtualItemServer *);
void serverInit(
        tVirtualItemServer *,
        unsigned int,
        unsigned int,
        const char *,
        const char *);
void serverRun(tVirtualItemServer *);
void logRotate(tVirtualItemServer *);

#endif // __SERVER_H__