Atrinik Server 2.5
Data Structures | Defines | Typedefs | Functions | Variables
socket/image.c File Reference
#include <global.h>
#include <loader.h>
#include "zlib.h"

Go to the source code of this file.

Data Structures

struct  FaceInfo
struct  FaceSets

Defines

#define MAX_FACE_SETS   1
#define MAX_IMAGE_SIZE   50000

Typedefs

typedef struct FaceInfo FaceInfo

Functions

int is_valid_faceset (int fsn)
void free_socket_images ()
void read_client_images ()
void SendFaceCmd (char *buf, int len, socket_struct *ns)
int esrv_send_face (socket_struct *ns, short face_num)
void face_get_data (int face, uint8 **ptr, uint16 *len)

Variables

static FaceSets facesets [MAX_FACE_SETS]

Detailed Description

This file deals with the image related communication to the client.

Definition in file image.c.


Define Documentation

#define MAX_FACE_SETS   1

Maximum different face sets.

Definition at line 35 of file image.c.

#define MAX_IMAGE_SIZE   50000

Maximum possible size of a single image in bytes.

Definition at line 118 of file image.c.


Typedef Documentation

typedef struct FaceInfo FaceInfo

Face info structure.


Function Documentation

int esrv_send_face ( socket_struct ns,
short  face_num 
)

Sends a face to client.

Parameters:
nsClient's socket.
face_numFace number to send.
Returns:
One of Send face return values.

Definition at line 278 of file image.c.

void face_get_data ( int  face,
uint8 **  ptr,
uint16 len 
)

Get face's data.

Parameters:
faceThe face.
[out]ptrPointer that will contain the image data, can be NULL.
[out]lenPointer that will contain the image data length, can be NULL.

Definition at line 315 of file image.c.

void free_socket_images ( )

Free all the information in face sets.

Definition at line 91 of file image.c.

int is_valid_faceset ( int  fsn)

Check if a face set is valid.

Parameters:
fsnThe face set number to check
Returns:
1 if the face set is valid, 0 otherwise

Definition at line 79 of file image.c.

void read_client_images ( )

Loads up all the image types into memory.

This way, we can easily send them to the client.

This function also generates client_bmaps file here.

At the moment, Atrinik only uses one face set file, no files like atrinik.1, atrinik.2, etc.

Definition at line 129 of file image.c.

void SendFaceCmd ( char *  buf,
int  len,
socket_struct ns 
)

Client has requested a face.

Parameters:
bufThe data sent to us.
lenLength of 'buf'.
nsClient's socket.

Definition at line 254 of file image.c.


Variable Documentation

FaceSets facesets[MAX_FACE_SETS] [static]

The face sets.

Definition at line 73 of file image.c.