Crossfire Client, Branch  R11627
Data Structures | Defines | Typedefs | Enumerations | Variables
client.h File Reference

This file includes the various dependencies header files needed by most everything. More...

#include <config.h>
#include <version.h>
#include <client-types.h>
#include <newclient.h>
#include <item.h>
#include <proto.h>
Include dependency graph for client.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Animations
struct  Cache_Entry
struct  ChildProcess
struct  ClientSocket
struct  Face_Information_struct
struct  FaceSets_struct
struct  LogEntry
struct  Msg_Type_Names
struct  PipeLog
struct  Player_Struct
struct  PlayerPosition
struct  Spell_struct
struct  Stat_struct

Defines

#define CAN_SMOOTH(__SQUARE, __LEVEL)
#define CFG_DM_OPENGL   2
#define CFG_DM_PIXMAP   0
#define CFG_DM_SDL   1
#define CFG_LT_NONE   0
#define CFG_LT_PIXEL   2
#define CFG_LT_PIXEL_BEST   3
#define CFG_LT_TILE   1
#define CHILD_PIPEERR(__child)   (__child->tube[2])
#define CHILD_PIPEIN(__child)   (__child->tube[0])
#define CHILD_PIPEOUT(__child)   (__child->tube[1])
#define CHILD_SILENTFAIL   8
#define CHILD_STDERR   4
#define CHILD_STDIN   1
#define CHILD_STDOUT   2
#define CHILD_TUBE   (CHILD_STDIN|CHILD_STDOUT|CHILD_STDERR)
#define COMMAND_WINDOW   10
#define CONFIG_APPLY_CONTAINER   28 /* Reapply container */
#define CONFIG_CACHE   5
#define CONFIG_CWINDOW   4
#define CONFIG_DARKNESS   22
#define CONFIG_DISPLAYMODE   10
#define CONFIG_DOWNLOAD   1
#define CONFIG_ECHO   2
#define CONFIG_FASTTCP   3
#define CONFIG_FOGWAR   6
#define CONFIG_FOODBEEP   21
#define CONFIG_GRAD_COLOR   24
#define CONFIG_ICONSCALE   7
#define CONFIG_LIGHTING   17
#define CONFIG_MAPHEIGHT   20
#define CONFIG_MAPSCALE   8
#define CONFIG_MAPSCROLL   29 /* Use bitmap operations for map scrolling */
#define CONFIG_MAPWIDTH   19
#define CONFIG_NUMS   32 /* This should always be the last value in the list */
#define CONFIG_POPUPS   9
#define CONFIG_PORT   23 /* Not sure if useful at all anymore */
#define CONFIG_RESISTS   25
#define CONFIG_SHOWGRID   16
#define CONFIG_SHOWICON   11
#define CONFIG_SIGNPOPUP   30
#define CONFIG_SMOOTH   26
#define CONFIG_SOUND   13
#define CONFIG_SPLASH   27
#define CONFIG_SPLITINFO   14
#define CONFIG_SPLITWIN   15
#define CONFIG_TIMESTAMP   31
#define CONFIG_TOOLTIPS   12
#define CONFIG_TRIMINFO   18
#define LOG_APPEND(_Entry)
#define LOG_NEW_ENTRY   (LogEntry*)calloc(1,sizeof(LogEntry))
#define LOG_SETMESSAGE(_Entry, _msg)   free(_Entry->message);_Entry->message=strdup(_msg)
#define LOG_SETORIGIN(_Entry, _orig)   free(_Entry->origin);_Entry->origin=strdup(_orig)
#define MAP_MAX_SIZE   31
#define MAX_FACE_SETS   20
#define MAX_IMAGE_SIZE   320
 Maximum size of image in each direction.
#define MAX_LOGS   200
#define MAX_MAP_OFFSET   8
#define MAX_SKILL   CS_NUM_SKILLS
#define MAXANIM   2000
#define MAXPIXMAPNUM   10000
#define MIN(X__, Y__)   ( (X__)<(Y__)?(X__):(Y__) )
#define MIN_ALLOCATED_MAP_SIZE   MAP_MAX_SIZE * 2
#define MULTKEYS
#define NUM_RESISTS   18
#define RI_IMAGE_INFO   0x1
#define RI_IMAGE_SUMS   0x2
#define SC_ALWAYS   2
#define SC_FIRERUN   1
#define SC_NORMAL   0
#define STRINGCOMMAND   0
#define VERSION_CS   1023
#define VERSION_SC   1029

Typedefs

typedef struct Animations Animations
typedef struct Cache_Entry Cache_Entry
typedef struct ChildProcess ChildProcess
typedef struct Player_Struct Client_Player
typedef struct ClientSocket ClientSocket
typedef struct
Face_Information_struct 
Face_Information
typedef struct FaceSets_struct FaceSets
typedef enum Input_State Input_State
typedef struct LogEntry LogEntry
typedef enum LogLevel LogLevel
typedef void(* LogListener )(LogEntry *)
typedef struct Msg_Type_Names Msg_Type_Names
typedef struct PipeLog PipeLog
typedef struct PlayerPosition PlayerPosition
typedef enum rangetype rangetype
typedef struct Spell_struct Spell
typedef struct Stat_struct Stats

Enumerations

enum  Input_State {
  Playing, Reply_One, Reply_Many, Configure_Keys,
  Command_Mode, Metaserver_Select
}
enum  LogLevel {
  LOG_DEBUG = 0, LOG_INFO = 1, LOG_WARNING = 2, LOG_ERROR = 3,
  LOG_CRITICAL = 4
}
enum  rangetype {
  range_bottom = -1, range_none = 0, range_bow = 1, range_magic = 2,
  range_wand = 3, range_rod = 4, range_scroll = 5, range_horn = 6,
  range_steal = 7, range_size = 8
}

Variables

Animations animations [MAXANIM]
char * client_libdir
int command_inscribe
const char *const config_names [CONFIG_NUMS]
 See common/init.c - basically, this is a string to number mapping that is used when loading/saving the values.
Client_Player cpl
ClientSocket csocket
uint64 * exp_table
uint16 exp_table_max
Face_Information face_info
TextManagerfirstTextManager
char * image_file
int last_used_skills [MAX_SKILL+1]
int logcount
LogEntryLogFirst
LogEntryLogLast
int meta_port
char * meta_server
int metaserver2_on
int metaserver_on
PlayerPosition pl_pos
int replyinfo_last_face
int replyinfo_status
int requestinfo_sent
const char *const resists_name [NUM_RESISTS]
char * server
char * skill_names [MAX_SKILL]
char * sound_server
uint32 tick
sint16 use_config [CONFIG_NUMS]
char VERSION_INFO [256]
sint16 want_config [CONFIG_NUMS]
int want_skill_exp

Detailed Description

This file includes the various dependencies header files needed by most everything.

It also declares structures and other variables that the GUI portion needs

Definition in file client.h.


Define Documentation

#define CAN_SMOOTH (   __SQUARE,
  __LEVEL 
)
Value:
( (                                       \
                                            (__SQUARE.heads[__LEVEL].face==0)  \
                                            && (__LEVEL >0)                    \
                                        )                                      \
                                        || (__SQUARE.smooth[layer])            \
                                     )

Definition at line 85 of file client.h.

Referenced by drawsmooth().

#define CFG_DM_OPENGL   2
#define CFG_DM_PIXMAP   0
#define CFG_DM_SDL   1
#define CFG_LT_NONE   0

Definition at line 186 of file client.h.

Referenced by read_config_window(), and setup_config_window().

#define CFG_LT_PIXEL   2

Definition at line 188 of file client.h.

Referenced by load_defaults(), read_config_window(), set_darkness(), and setup_config_window().

#define CFG_LT_PIXEL_BEST   3

Definition at line 189 of file client.h.

Referenced by read_config_window(), set_darkness(), and setup_config_window().

#define CFG_LT_TILE   1

Definition at line 187 of file client.h.

Referenced by init_client_vars(), load_defaults(), read_config_window(), and setup_config_window().

#define CHILD_PIPEERR (   __child)    (__child->tube[2])

Definition at line 415 of file client.h.

Referenced by raiseChild().

#define CHILD_PIPEIN (   __child)    (__child->tube[0])

Definition at line 413 of file client.h.

Referenced by raiseChild().

#define CHILD_PIPEOUT (   __child)    (__child->tube[1])

Definition at line 414 of file client.h.

Referenced by raiseChild().

#define CHILD_SILENTFAIL   8

Definition at line 402 of file client.h.

Referenced by raiseChild().

#define CHILD_STDERR   4

Definition at line 401 of file client.h.

Referenced by init_sounds(), logChildPipe(), and raiseChild().

#define CHILD_STDIN   1

Definition at line 399 of file client.h.

Referenced by init_sounds(), and raiseChild().

#define CHILD_STDOUT   2

Definition at line 400 of file client.h.

Referenced by init_sounds(), logChildPipe(), and raiseChild().

Definition at line 403 of file client.h.

Referenced by raiseChild().

#define COMMAND_WINDOW   10

Definition at line 54 of file client.h.

Referenced by init_client_vars(), load_defaults(), and set_command_window().

#define CONFIG_APPLY_CONTAINER   28 /* Reapply container */

Definition at line 179 of file client.h.

Referenced by close_container(), and init_client_vars().

#define CONFIG_CACHE   5
#define CONFIG_CWINDOW   4
#define CONFIG_DARKNESS   22
#define CONFIG_DISPLAYMODE   10
#define CONFIG_DOWNLOAD   1
#define CONFIG_ECHO   2
#define CONFIG_FASTTCP   3
#define CONFIG_FOGWAR   6
#define CONFIG_FOODBEEP   21
#define CONFIG_GRAD_COLOR   24
#define CONFIG_ICONSCALE   7
#define CONFIG_LIGHTING   17
#define CONFIG_MAPHEIGHT   20
#define CONFIG_MAPSCALE   8
#define CONFIG_MAPSCROLL   29 /* Use bitmap operations for map scrolling */

Definition at line 180 of file client.h.

Referenced by init_client_vars(), init_windows(), and mapdata_scroll().

#define CONFIG_MAPWIDTH   19
#define CONFIG_NUMS   32 /* This should always be the last value in the list */

Definition at line 183 of file client.h.

Referenced by init_client_vars(), init_windows(), load_defaults(), parse_args(), and save_defaults().

#define CONFIG_POPUPS   9
#define CONFIG_PORT   23 /* Not sure if useful at all anymore */
#define CONFIG_RESISTS   25
#define CONFIG_SHOWGRID   16

Definition at line 167 of file client.h.

Referenced by init_client_vars().

#define CONFIG_SHOWICON   11

Definition at line 162 of file client.h.

Referenced by applyconfig(), init_client_vars(), init_windows(), load_defaults(), and parse_args().

#define CONFIG_SIGNPOPUP   30

Definition at line 181 of file client.h.

Referenced by init_client_vars(), and sign_callback().

#define CONFIG_SMOOTH   26
#define CONFIG_SOUND   13
#define CONFIG_SPLASH   27

Definition at line 178 of file client.h.

Referenced by get_root_display(), init_client_vars(), init_windows(), load_defaults(), and parse_args().

#define CONFIG_SPLITINFO   14
#define CONFIG_SPLITWIN   15
#define CONFIG_TIMESTAMP   31

Definition at line 182 of file client.h.

Referenced by draw_info(), and init_client_vars().

#define CONFIG_TOOLTIPS   12

Definition at line 163 of file client.h.

Referenced by applyconfig(), create_windows(), and init_client_vars().

#define CONFIG_TRIMINFO   18

Definition at line 169 of file client.h.

Referenced by draw_info(), init_client_vars(), init_windows(), and parse_args().

#define LOG_APPEND (   _Entry)
Value:
if (LogLast) {\
    LogLast->next=_Entry;\
  } else {\
    LogFirst=_Entry;\
  };\
  LogLast=_Entry;_Entry->next=NULL;\
  if (++logcount > MAX_LOGS)\
  {\
      LogEntry* old = LogFirst;\
      LogFirst = LogFirst -> next;\
      if (old->message) free (old->message);\
      if (old->origin) free (old->origin);\
  }

Definition at line 376 of file client.h.

Referenced by LOG().

#define LOG_NEW_ENTRY   (LogEntry*)calloc(1,sizeof(LogEntry))

Definition at line 389 of file client.h.

Referenced by LOG().

#define LOG_SETMESSAGE (   _Entry,
  _msg 
)    free(_Entry->message);_Entry->message=strdup(_msg)

Definition at line 390 of file client.h.

Referenced by LOG().

#define LOG_SETORIGIN (   _Entry,
  _orig 
)    free(_Entry->origin);_Entry->origin=strdup(_orig)

Definition at line 391 of file client.h.

Referenced by LOG().

#define MAP_MAX_SIZE   31
#define MAX_FACE_SETS   20
#define MAX_IMAGE_SIZE   320

Maximum size of image in each direction.

This is needed for the x11 client, which wants to initalize some data once. Increasing this would likely only need a bigger footprint

Definition at line 316 of file client.h.

Referenced by init_pngx_loader().

#define MAX_LOGS   200

Definition at line 375 of file client.h.

#define MAX_MAP_OFFSET   8

Definition at line 457 of file client.h.

#define MAX_SKILL   CS_NUM_SKILLS
#define MAXANIM   2000

Definition at line 63 of file client.h.

Referenced by AnimCmd(), and mapdata_animation().

#define MAXPIXMAPNUM   10000
#define MIN (   X__,
  Y__ 
)    ( (X__)<(Y__)?(X__):(Y__) )

Definition at line 514 of file client.h.

Referenced by draw_info(), and metaserver_select().

Definition at line 450 of file client.h.

#define MULTKEYS

Definition at line 44 of file client.h.

#define NUM_RESISTS   18
#define RI_IMAGE_INFO   0x1

Definition at line 493 of file client.h.

Referenced by get_image_info(), and negotiate_connection().

#define RI_IMAGE_SUMS   0x2

Definition at line 494 of file client.h.

Referenced by negotiate_connection().

#define SC_ALWAYS   2

Definition at line 69 of file client.h.

#define SC_FIRERUN   1

Definition at line 68 of file client.h.

Referenced by clear_fire(), clear_fire_run(), clear_run(), and stop_run().

#define SC_NORMAL   0

Definition at line 67 of file client.h.

Referenced by fire_dir(), move_player(), and run_dir().

#define STRINGCOMMAND   0

Definition at line 56 of file client.h.

#define VERSION_CS   1023

Definition at line 46 of file client.h.

Referenced by check_server_version(), SendVersion(), and VersionCmd().

#define VERSION_SC   1029

Definition at line 47 of file client.h.

Referenced by check_server_version(), SendVersion(), and VersionCmd().


Typedef Documentation

typedef struct Animations Animations
typedef struct Cache_Entry Cache_Entry
typedef struct ChildProcess ChildProcess
typedef struct Player_Struct Client_Player
typedef struct ClientSocket ClientSocket
typedef struct FaceSets_struct FaceSets
typedef enum Input_State Input_State
typedef struct LogEntry LogEntry
typedef enum LogLevel LogLevel
typedef void(* LogListener)(LogEntry *)

Definition at line 374 of file client.h.

typedef struct PipeLog PipeLog
typedef enum rangetype rangetype
typedef struct Spell_struct Spell
typedef struct Stat_struct Stats

Enumeration Type Documentation

Enumerator:
Playing 
Reply_One 
Reply_Many 
Configure_Keys 
Command_Mode 
Metaserver_Select 

Definition at line 113 of file client.h.

enum LogLevel
Enumerator:
LOG_DEBUG 
LOG_INFO 
LOG_WARNING 
LOG_ERROR 
LOG_CRITICAL 

Definition at line 361 of file client.h.

enum rangetype
Enumerator:
range_bottom 
range_none 
range_bow 
range_magic 
range_wand 
range_rod 
range_scroll 
range_horn 
range_steal 
range_size 

Definition at line 116 of file client.h.


Variable Documentation

char * client_libdir

Definition at line 61 of file client.c.

Referenced by init_client_vars(), init_keys(), and keys_init().

Definition at line 75 of file client.c.

Referenced by inscribe_magical_scroll(), menu_spells(), and SetupCmd().

const char* const config_names[CONFIG_NUMS]

See common/init.c - basically, this is a string to number mapping that is used when loading/saving the values.

Definition at line 40 of file init.c.

Referenced by load_defaults(), and save_defaults().

uint64* exp_table

Definition at line 73 of file client.c.

Referenced by draw_message_window(), get_exp_info(), and init_client_vars().

Definition at line 72 of file client.c.

Referenced by draw_message_window(), get_exp_info(), and init_client_vars().

Definition at line 495 of file commands.c.

Referenced by getTextManager(), setTextManager(), and SetupCmd().

char * image_file

Definition at line 65 of file client.c.

Referenced by draw_stats(), init_client_vars(), and use_skill().

int logcount

Definition at line 135 of file misc.c.

Definition at line 133 of file misc.c.

Referenced by createBugTracker().

Definition at line 134 of file misc.c.

int meta_port

Definition at line 67 of file client.c.

Referenced by do_metaserver(), main(), and metaserver1_thread().

char* meta_server

Definition at line 61 of file client.c.

Referenced by do_metaserver(), main(), metaserver1_thread(), and metaserver_select().

Definition at line 69 of file client.c.

Referenced by metaserver2_get_info().

Definition at line 69 of file client.c.

Referenced by metaserver1_get_info(), and metaserver_get_info().

Definition at line 68 of file client.c.

Referenced by get_image_sums(), and negotiate_connection().

Definition at line 68 of file client.c.

Referenced by get_image_info(), and negotiate_connection().

Definition at line 68 of file client.c.

Referenced by negotiate_connection().

const char* const resists_name[NUM_RESISTS]

Definition at line 80 of file client.c.

Referenced by draw_message_window(), and update_stat_mapping().

char* server
char * sound_server

Definition at line 62 of file client.c.

Referenced by init_sounds(), init_windows(), load_defaults(), parse_args(), and save_defaults().

Definition at line 70 of file client.c.

Referenced by animate_inventory(), animate_look(), do_timeout(), and TickCmd().

char VERSION_INFO[256]

Definition at line 67 of file client.c.

Referenced by init_windows(), negotiate_connection(), and parse_args().