#include <global.h>
#include <sproto.h>
#include <newclient.h>
#include <newserver.h>
#include <loader.h>
Go to the source code of this file.
Data Structures | |
struct | FaceInfo |
Information about one image. More... | |
struct | FaceSets |
Information about one face set. More... | |
Defines | |
#define | MAX_FACE_SETS 20 |
Maximum number of image sets the program will handle. | |
#define | MAX_IMAGE_SIZE 10000 |
Typedefs | |
typedef FaceInfo | FaceInfo |
Information about one image. | |
Functions | |
int | is_valid_faceset (int fsn) |
Checks specified faceset is valid. | |
void | free_socket_images () |
Frees all faceset information. | |
int | get_face_fallback (int faceset, int imageno) |
This returns the set we will actually use when sending a face. | |
void | check_faceset_fallback (int faceset, int togo) |
Checks fallback are correctly defined. | |
void | read_client_images () |
Loads all the image types into memory. | |
void | SetFaceMode (char *buf, int len, NewSocket *ns) |
Client tells us what type of faces it wants. | |
void | SendFaceCmd (char *buff, int len, NewSocket *ns) |
Client has requested pixmap that it somehow missed getting. | |
void | esrv_send_face (NewSocket *ns, short face_num, int nocache) |
Sends a face to the client. | |
void | send_image_info (NewSocket *ns, char *params) |
Sends the number of images, checksum of the face file, and the image_info file information. | |
void | send_image_sums (NewSocket *ns, char *params) |
Sends requested face information. | |
Variables | |
FaceSets | facesets [MAX_FACE_SETS] |
All facesets. |
Definition in file socket/image.c.
|
Maximum number of image sets the program will handle.
Definition at line 47 of file socket/image.c. Referenced by free_socket_images(), is_valid_faceset(), read_client_images(), and send_image_info(). |
|
Definition at line 157 of file socket/image.c. Referenced by read_client_images(). |
|
Information about one image.
|
|
Checks fallback are correctly defined. This is a simple recursive function that makes sure the fallbacks are all proper (eg, the fall back to defined sets, and also eventually fall back to 0). At the top level, togo is set to MAX_FACE_SETS, if togo gets to zero, it means we have a loop. This is only run when we first load the facesets. Definition at line 138 of file socket/image.c. References facesets, FaceSets::fallback, llevError, LOG(), and FaceSets::prefix. Referenced by read_client_images(). |
|
|
Frees all faceset information.
Definition at line 82 of file socket/image.c. References FaceInfo::data, FaceSets::faces, facesets, MAX_FACE_SETS, nrofpixmaps, FaceSets::prefix, and size. Referenced by free_all_newserver(). |
|
This returns the set we will actually use when sending a face. This is used because the image files may be sparse. This function is recursive. imageno is the face number we are trying to send If face is not found in specified faceset, tries with 'fallback' faceset.
Definition at line 112 of file socket/image.c. References FaceInfo::data, FaceSets::faces, facesets, llevError, LOG(), and FaceSets::prefix. Referenced by esrv_send_face(), and send_image_sums(). |
|
Checks specified faceset is valid.
Definition at line 73 of file socket/image.c. References facesets, FALSE, MAX_FACE_SETS, FaceSets::prefix, and TRUE. Referenced by SetUp(). |
|
Loads all the image types into memory. This way, we can easily send them to the client. We should really do something better than abort on any errors - on the other hand, these are all fatal to the server (can't work around them), but the abort just seems a bit messy (exit would probably be better.) Couple of notes: We assume that the faces are in a continous block. This works fine for now, but this could perhaps change in the future Function largely rewritten May 2000 to be more general purpose. The server itself does not care what the image data is - to the server, it is just data it needs to allocate. As such, the code is written to do such. Definition at line 176 of file socket/image.c. References check_faceset_fallback(), FaceInfo::checksum, close_and_delete(), FaceInfo::data, Settings::datadir, FaceInfo::datalen, FaceSets::faces, facesets, HUGE_BUF, len, llevDebug, llevError, LOG(), MAX_FACE_SETS, MAX_IMAGE_SIZE, nrofpixmaps, open_and_uncompress(), FaceSets::prefix, ROTATE_RIGHT, settings, and strdup_local(). Referenced by init_ericserver(). |
|
Sends the number of images, checksum of the face file, and the image_info file information. See the doc/Developers/protocol if you want further detail. Definition at line 387 of file socket/image.c. References bmaps_checksum, SockList::buf, FaceSets::comment, FaceSets::extension, facesets, FaceSets::fallback, FaceSets::fullname, SockList::len, MAX_FACE_SETS, MAXSOCKBUF, nrofpixmaps, FaceSets::prefix, Send_With_Handling(), and FaceSets::size. Referenced by RequestInfo(). |
|
Sends requested face information.
Definition at line 416 of file socket/image.c. References SockList::buf, cs_write_string(), NewSocket::faces_sent, NewSocket::faceset, facesets, get_face_fallback(), SockList::len, llevError, LOG(), MAX_BUF, MAXSOCKBUF, new_face_struct::name, new_faces, nrofpixmaps, Send_With_Handling(), SockList_AddChar(), SockList_AddInt(), and SockList_AddShort(). Referenced by RequestInfo(). |
|
Client has requested pixmap that it somehow missed getting. This will be called often if the client is caching images. Definition at line 307 of file socket/image.c. References esrv_send_face(). |
|
Client tells us what type of faces it wants. Also sets the caching attribute. Definition at line 281 of file socket/image.c. References CF_FACE_CACHE, CF_FACE_NONE, CF_FACE_PNG, NewSocket::facecache, llevDebug, LOG(), NDI_RED, and Write_String_To_Socket(). |
|
All facesets.
Definition at line 67 of file socket/image.c. Referenced by check_faceset_fallback(), esrv_send_face(), free_socket_images(), get_face_fallback(), is_valid_faceset(), read_client_images(), send_image_info(), and send_image_sums(). |