Crossfire Client, Branches
R11627
|
#include <config.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
#include <ctype.h>
#include "client.h"
#include "external.h"
Go to the source code of this file.
Data Structures | |
struct | FD_Cache |
struct | Image_Cache |
Macros | |
#define | IMAGE_HASH 8192 |
#define | ROTATE_RIGHT(c) if ((c) & 01) (c) = ((c) >>1) + 0x80000000; else (c) >>= 1; |
Functions | |
void | display_newpng (int face, uint8 *buf, int buflen, int setnum) |
void | Face2Cmd (uint8 *data, int len) |
void | finish_face_cmd (int pnum, uint32 checksum, int has_sum, char *face, int faceset) |
void | get_image_info (uint8 *data, int len) |
void | get_image_sums (char *data, int len) |
void | Image2Cmd (uint8 *data, int len) |
static Cache_Entry * | image_add_hash (char *imagename, char *filename, uint32 checksum, uint32 ispublic) |
static Cache_Entry * | image_find_cache_entry (char *imagename, uint32 checksum, int has_sum) |
static sint32 | image_find_hash (char *str) |
static uint32 | image_hash_name (char *str, int tablesize) |
static void | image_process_line (char *line, uint32 ispublic) |
static void | image_remove_hash (char *imagename, Cache_Entry *ce) |
void | init_common_cache_data (void) |
static int | load_image (char *filename, uint8 *data, int *len, uint32 *csum) |
void | requestface (int pnum, char *facename) |
void | reset_image_cache_data (void) |
Variables | |
Face_Information | face_info |
char | facecachedir [MAX_BUF] |
static char * | facetoname [MAXPIXMAPNUM] |
struct FD_Cache | fd_cache [MAX_FACE_SETS] |
struct Image_Cache | image_cache [IMAGE_HASH] |
const char *const | rcsid_common_image_c |
#define IMAGE_HASH 8192 |
Definition at line 165 of file image.c.
Referenced by image_add_hash(), image_find_hash(), and init_common_cache_data().
#define ROTATE_RIGHT | ( | c | ) | if ((c) & 01) (c) = ((c) >>1) + 0x80000000; else (c) >>= 1; |
Definition at line 46 of file image.c.
Referenced by display_newpng(), and load_image().
void display_newpng | ( | int | face, |
uint8 * | buf, | ||
int | buflen, | ||
int | setnum | ||
) |
Definition at line 535 of file image.c.
References CONFIG_CACHE, create_and_rescale_image_from_data(), Face_Information_struct::facesets, height, image_add_hash(), LOG(), LOG_WARNING, MAX_BUF, MAX_FACE_SETS, png_to_data(), FaceSets_struct::prefix, ROTATE_RIGHT, use_config, and width.
Referenced by Image2Cmd().
void Face2Cmd | ( | uint8 * | data, |
int | len | ||
) |
Definition at line 491 of file image.c.
References checksum, CONFIG_CACHE, finish_face_cmd(), GetInt_String(), GetShort_String(), LOG(), LOG_WARNING, and use_config.
void finish_face_cmd | ( | int | pnum, |
uint32 | checksum, | ||
int | has_sum, | ||
char * | face, | ||
int | faceset | ||
) |
Definition at line 400 of file image.c.
References associate_cache_entry(), create_and_rescale_image_from_data(), Cache_Entry::filename, Cache_Entry::image_data, image_find_cache_entry(), image_remove_hash(), Cache_Entry::ispublic, load_image(), LOG(), LOG_WARNING, png_to_data(), and requestface().
Referenced by Face2Cmd(), and get_image_sums().
void get_image_info | ( | uint8 * | data, |
int | len | ||
) |
Definition at line 653 of file image.c.
References Face_Information_struct::bmaps_checksum, FaceSets_struct::comment, cs_print_string(), csocket, draw_info(), FaceSets_struct::extension, Face_Information_struct::faceset, Face_Information_struct::facesets, FaceSets_struct::fallback, ClientSocket::fd, FaceSets_struct::fullname, Face_Information_struct::have_faceset_info, LOG(), LOG_WARNING, MAX_BUF, MAX_FACE_SETS, NDI_RED, Face_Information_struct::num_images, FaceSets_struct::prefix, replyinfo_status, RI_IMAGE_INFO, FaceSets_struct::size, strdup_local(), and Face_Information_struct::want_faceset.
Referenced by ReplyInfoCmd().
void get_image_sums | ( | char * | data, |
int | len | ||
) |
Definition at line 737 of file image.c.
References checksum, finish_face_cmd(), GetInt_String(), GetShort_String(), LOG(), LOG_WARNING, and replyinfo_last_face.
Referenced by ReplyInfoCmd().
void Image2Cmd | ( | uint8 * | data, |
int | len | ||
) |
Definition at line 514 of file image.c.
References display_newpng(), GetInt_String(), LOG(), and LOG_WARNING.
|
static |
Definition at line 278 of file image.c.
References Image_Cache::cache_entry, checksum, Cache_Entry::checksum, Cache_Entry::filename, image_cache, Cache_Entry::image_data, IMAGE_HASH, image_hash_name(), Image_Cache::image_name, Cache_Entry::ispublic, LOG(), LOG_WARNING, and Cache_Entry::next.
Referenced by display_newpng(), and image_process_line().
|
static |
Definition at line 260 of file image.c.
References Image_Cache::cache_entry, Cache_Entry::checksum, image_cache, image_find_hash(), and Cache_Entry::next.
Referenced by finish_face_cmd().
|
static |
Definition at line 206 of file image.c.
References image_cache, IMAGE_HASH, image_hash_name(), LOG(), and LOG_WARNING.
Referenced by image_find_cache_entry(), and image_remove_hash().
|
static |
Definition at line 187 of file image.c.
Referenced by image_add_hash(), and image_find_hash().
|
static |
Definition at line 318 of file image.c.
References checksum, image_add_hash(), LOG(), LOG_WARNING, and MAX_BUF.
Referenced by init_common_cache_data().
|
static |
Definition at line 226 of file image.c.
References Image_Cache::cache_entry, Cache_Entry::filename, image_cache, image_find_hash(), LOG(), LOG_ERROR, and Cache_Entry::next.
Referenced by finish_face_cmd().
void init_common_cache_data | ( | void | ) |
Definition at line 332 of file image.c.
References CONFIG_CACHE, draw_info(), FD_Cache::fd, fd_cache, image_cache, IMAGE_HASH, image_process_line(), MAX_BUF, MAX_FACE_SETS, MAXPIXMAPNUM, FD_Cache::name, NDI_RED, and want_config.
Referenced by init_cache_data().
Definition at line 65 of file image.c.
References Face_Information_struct::cache_hits, face_info, fd_cache, LOG(), LOG_ERROR, LOG_WARNING, MAX_FACE_SETS, name, and ROTATE_RIGHT.
Referenced by finish_face_cmd().
void requestface | ( | int | pnum, |
char * | facename | ||
) |
Definition at line 381 of file image.c.
References Face_Information_struct::cache_misses, cs_print_string(), csocket, ClientSocket::fd, and strdup_local().
Referenced by finish_face_cmd().
void reset_image_cache_data | ( | void | ) |
Definition at line 474 of file image.c.
References CONFIG_CACHE, MAXPIXMAPNUM, and want_config.
Referenced by reset_image_data().
Face_Information face_info |
Definition at line 167 of file image.c.
Referenced by applyconfig(), configdialog(), init_client_vars(), init_windows(), load_defaults(), load_image(), negotiate_connection(), parse_args(), read_config_window(), reset_client_vars(), save_defaults(), setup_config_window(), and SetupCmd().
|
static |
struct FD_Cache fd_cache[MAX_FACE_SETS] |
Referenced by init_common_cache_data(), and load_image().
struct Image_Cache image_cache[IMAGE_HASH] |
Referenced by image_add_hash(), image_find_cache_entry(), image_find_hash(), image_remove_hash(), and init_common_cache_data().