Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

nanomud.h File Reference

Go to the source code of this file.

Data Structures

struct  ansi_table
struct  hash
struct  poss
struct  sbuff
struct  sdata
struct  session_data
struct  tagECHOREPLY
struct  tagECHOREQUEST
struct  tagICMPHDR
struct  tagIPHDR
struct  termbuf
struct  termbuffer
struct  TerminalControl

Defines

#define ANSI_BLUE   "\e[0;34m"
#define ANSI_C_1BLINK   "\e[5m"
#define ANSI_C_BACK   "\e[7m"
#define ANSI_C_BLUE   "\e[1;34m"
#define ANSI_C_CYAN   "\e[1;36m"
#define ANSI_C_GREEN   "\e[1;32m"
#define ANSI_C_GREY   "\e[1;30m"
#define ANSI_C_MAGENTA   "\e[1;35m"
#define ANSI_C_RED   "\e[1;31m"
#define ANSI_C_WHITE   "\e[1;37m"
#define ANSI_C_YELLOW   "\e[1;33m"
#define ANSI_CLEAR   "\e[0m"
#define ANSI_CYAN   "\e[0;36m"
#define ANSI_GREEN   "\e[0;32m"
#define ANSI_MAGENTA   "\e[0;35m"
#define ANSI_RED   "\e[0;31m"
#define ANSI_WHITE   "\e[0;37m"
#define ANSI_YELLOW   "\e[0;33m"
#define AO   245
#define AT_BLINK   4
#define AT_LINK   8
#define AT_NONE   0
#define AT_REVERSE   2
#define AT_UNDERLINE   1
#define AYT   246
#define BG_MASK   0x00F00000UL
#define BG_SHIFT   20
#define BLACK   4
#define BLUE   2
#define BMASK   0x70
#define BOOL   short unsigned int
#define bool   short unsigned int
#define BREAK   243
#define BRIGHT   0x01000000UL
#define C_BLACK   12
#define C_BLUE   10
#define C_CYAN   14
#define C_GREEN   11
#define C_MAGENTA   15
#define C_RED   9
#define C_WHITE   16
#define C_YELLOW   13
#define CYAN   6
#define DEBUG_FILE   "debug1.txt"
#define DEFAULT   0x00980000UL
#define DM   242
#define DO   253
#define DONT   254
#define EC   247
#define EL   248
#define EOR   239
#define FALSE   0
#define FG_MASK   0x000F0000UL
#define FG_SHIFT   16
#define FMASK   0x07
#define free(x)   nano_free (x, __FILE__, __LINE__)
#define GA   249
#define GET_BMASK   (a) ((a) & 0x70) >> 4)
#define GET_FMASK   (a) ((a) & 0x07)
#define GREEN   3
#define GREY   17
#define handle_except(a, b, c, d)   _except_handler(a,b,c,d, __FILE__, __LINE__)
#define html_log   "mudlog.html"
#define IAC   255
#define ICMP_ECHOREPLY   0
#define ICMP_ECHOREQ   8
#define ID_ABOUT_OK_BUTTON   1200
#define ID_CONFIG_COLOR   1601
#define ID_CONFIG_EA   1606
#define ID_CONFIG_EB   1614
#define ID_CONFIG_ECC   1611
#define ID_CONFIG_EM   1609
#define ID_CONFIG_EP   1608
#define ID_CONFIG_EPP   1612
#define ID_CONFIG_ES   1605
#define ID_CONFIG_ESS   1610
#define ID_CONFIG_ESSS   1615
#define ID_CONFIG_ET   1607
#define ID_CONFIG_ETL   1603
#define ID_CONFIG_ETN   1616
#define ID_CONFIG_EUR   1613
#define ID_CONFIG_ODS   1604
#define ID_CONFIG_UMC   1602
#define ID_Credit_OK_BUTTON   1201
#define ID_EDIT_COPY   1103
#define ID_EDIT_FIND   1100
#define ID_EDIT_FIND_NEXT   1101
#define ID_EDIT_INPUT   1101
#define ID_EDIT_OUTPUT   1100
#define ID_EDIT_PASTE   1102
#define ID_EDIT_SALL   1105
#define ID_EDIT_SEND   1104
#define ID_FILE_CLOSE   1004
#define ID_FILE_DISCONNECT   1008
#define ID_FILE_EXIT   1001
#define ID_FILE_EXPORT_ANSI   1007
#define ID_FILE_EXPORT_HTML   1005
#define ID_FILE_EXPORT_TEXT   1006
#define ID_FILE_IMPORT_ANSI   10088
#define ID_FILE_NEW   1003
#define ID_FILE_OPEN   1002
#define ID_HELP_ABOUT   1027
#define ID_HELP_CREDITS   1028
#define ID_HELP_HELP   1026
#define ID_MAINSCROLL   1301
#define ID_MUDINPUT   1300
#define ID_SETTINGS_CONFIGURE   1014
#define ID_SETTINGS_OPTIONS   1016
#define ID_SETTINGS_STATUS   1015
#define ID_STATUS   1600
#define ID_TERMINAL   1400
#define ID_TIMER_PING   1500
#define IP   244
#define IS_IN_DEBUGGING_MODE   0
#define LOWER(c)   ((c) >= 'A' && (c) <= 'Z' ? (c)+'a'-'A' : (c))
#define MAGENTA   7
#define malloc(x)   nano_malloc(x, __FILE__, __LINE__)
#define MOUSE_LEFT   2
#define MOUSE_MIDDLE   3
#define MOUSE_RIGHT   1
#define Mud_client_Version   "0.3.1 Build: 10402"
#define MUD_RECV   1006
#define MYSOCKET_CONNECT   22222
#define NCOLORS   24
#define NOP   241
#define realloc(x, y)   nano_realloc (x,y, __FILE__, __LINE__)
#define RED   1
#define REQ_DATASIZE   32
#define REVERSE(a)   (SET_BMASK(GET_FMASK(a)) | SET_FMASK(a)))
#define safefree   free
#define safemalloc   malloc
#define SB   250
#define SE   240
#define SET_BMASK   (a) ((a) << 4)
#define SET_FMASK   (a) (a)
#define SETTINGS_FILE   "nanomud_settings.nmd"
#define sfree   free
#define smalloc   safemalloc
#define somalloc(z)   malloc(sizeof(z))
#define SYNCH   242
#define TELOPT_BINARY   0
#define TELOPT_BM   19
#define TELOPT_DET   20
#define TELOPT_ECHO   1
#define TELOPT_EOR   25
#define TELOPT_EXOPL   255
#define TELOPT_LOGOUT   18
#define TELOPT_NAMS   4
#define TELOPT_NAOCRD   10
#define TELOPT_NAOFFD   13
#define TELOPT_NAOHTD   12
#define TELOPT_NAOHTS   11
#define TELOPT_NAOL   8
#define TELOPT_NAOLFD   16
#define TELOPT_NAOP   9
#define TELOPT_NAOVTD   15
#define TELOPT_NAOVTS   14
#define TELOPT_RCP   2
#define TELOPT_RCTE   7
#define TELOPT_SGA   3
#define TELOPT_SNDLOC   23
#define TELOPT_STATUS   5
#define TELOPT_SUPDUP   21
#define TELOPT_SUPDUPOUTPUT   22
#define TELOPT_TM   6
#define TELOPT_TTYPE   24
#define TELOPT_XASCII   17
#define TELQUAL_IS   0
#define TELQUAL_SEND   1
#define TRUE   1
#define TRUE_BLACK   18
#define UINT_MAX   65535
#define ul_int   unsigned long int
#define ULINT_MAX   4294967292
#define UPPER(c)   ((c) >= 'a' && (c) <= 'z' ? (c)+'A'-'a' : (c))
#define WHITE   8
#define WILL   251
#define WIN_32_LEAN_AND_MEAN
#define WM_SOCKET   1005
#define WONT   252
#define YELLOW   5

Typedefs

typedef linked_buffer_chain BUF_CHAIN
typedef linked_buffer BUFFER
typedef linked_buffer_chain CHAIN_BUF
typedef tagECHOREPLY ECHOREPLY
typedef tagECHOREQUEST ECHOREQUEST
typedef hash HASH
typedef tagICMPHDR ICMPHDR
typedef tagIPHDR IPHDR
typedef tagECHOREPLYPECHOREPLY
typedef tagECHOREQUESTPECHOREQUEST
typedef tagICMPHDRPICMPHDR
typedef tagIPHDRPIPHDR
typedef sbuff SBUF
typedef session_data SDATA
typedef termbuf TBUF
typedef termbuffer TERMBUF

Enumerations

enum  colors {
  red, blue, green, black,
  yellow, cyan, magenta
}
enum  term_state {
  normal, escape, openbrack, params,
  attribs
}

Functions

LRESULT APIENTRY AboutProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
void add_newline (const char *buffer)
void check_output (void)
DWORD WINAPI check_ping (LPVOID param)
void check_url (TERMBUF *term)
void CheckPing ()
void chop_line (TERMBUF *ter)
void clear_buffer (void)
void ClearTerminal (void)
void create_hdc_buf (void)
void create_s_table (void)
void CreateAboutBox (void)
void CreateSettings (void)
HWND CreateTerminal (HWND hwndWindow, HINSTANCE inst)
LRESULT APIENTRY CreditProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
void do_nasty (void)
DWORD WINAPI do_parse (TERMBUF *ter, BOOL bleh)
void do_term_test ()
void do_update_paint (HDC hdc, int left, int top, int right, int bottom)
void do_url (const char *url)
TERMBUFfetch_line (unsigned long int idx)
void fix_line (TERMBUF *line1, TERMBUF *line2)
void FlushBuffer (char *buffer, int colour2, int bKcolour2)
void FormatText (HWND hwnd)
HDC get_context ()
unsigned long int get_hash (unsigned char *str)
void get_scroll_pos ()
TerminalControlGetTerminal (HWND hwnd)
void give_term_debug (char *to_echo,...)
void give_term_echo (char *to_echo,...)
void give_term_error (char *to_echo,...)
u_short in_cksum (u_short *addr, int len)
void init_hash (int hashes)
void init_scripts (void)
void InitTerminal (HINSTANCE hInst)
void interp_mouse (int rws, int cls, int state)
void load_settings ()
void LOG (char *fmt,...)
void log_html (const char *str, int colour)
void MakeBuffers (void)
void * nano_malloc (size_t chunk, const char *file, int line)
TERMBUFnew_line (void)
TERMBUFnew_term (char *buffer)
TERMBUFnew_termbuffer (void)
char * one_argument (char *argument, char *arg_first)
LRESULT PaintTerm (TerminalControl *ccp, WPARAM wParam, LPARAM lParam)
void parse_ansi (TERMBUF *ter, BOOL is_logging_html)
void parse_script (const unsigned char *script)
void realize_lines (char *line)
DWORD RecvEchoReply (SOCKET s, LPSOCKADDR_IN lpsaFrom, u_char *pTTL)
void redraw_terminal (void)
void save_settings ()
char * script_strip (char *argument, char *arg_first)
void scroll_term (long int pos, long int to)
int SendEchoRequest (SOCKET s, LPSOCKADDR_IN lpstToAddr)
void set_scroll (unsigned long int t, unsigned long int s, unsigned long int p)
void SetTerminal (HWND hwnd, TerminalControl *ccp)
LRESULT CALLBACK SettingsProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
bool str_cmp (const char *astr, const char *bstr)
char * str_dup (const char *str)
BOOL str_search (const char *str)
BOOL string_compare (const char *ostr, const char *tstr)
char * strip_ansi (const char *str)
void term_run (void)
void terminal_resize ()
LRESULT CALLBACK TerminalProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
void update_scroll (void)
void update_term (void)
int WaitForEchoReply (SOCKET s)
BOOL wraps (char *buf)
void write_buffer (const char *str)

Variables

WNDPROC AboutProc
TERMBUFbackcurr
TERMBUFbackfirst
TERMBUFbackfree
TERMBUFbacklist
TERMBUFbackprev
int bKcolour
COLORREF colors [NCOLORS]
int colour
WNDPROC CreditProc
ul_int curline
RGBTRIPLE defpal [NCOLORS]
bool echo_off
HINSTANCE g_hInst
HFONT hf
LPLOGPALETTE logpal
TERMBUFmainfree
HWND MainScroll
HWND MudAbout
HWND MudCredit
HWND MudInput
HWND MudMain
RECT mudrect
HWND MudSettings
HWND MudStatus
HWND MudWindow
BOOL nasty
int old_colour
char oldbuff
WNDPROC OldProc
HPALETTE pal
BUFFERscreen_buffer
WNDPROC SettingsProc
SOCKET sock
bool tabbed
TBUFtbuf
HWND Terminal
SDATAthis_session
RECT trc
WSADATA wsaData


Define Documentation

#define ANSI_BLUE   "\e[0;34m"
 

Definition at line 307 of file nanomud.h.

#define ANSI_C_1BLINK   "\e[5m"
 

Definition at line 319 of file nanomud.h.

#define ANSI_C_BACK   "\e[7m"
 

Definition at line 320 of file nanomud.h.

#define ANSI_C_BLUE   "\e[1;34m"
 

Definition at line 315 of file nanomud.h.

#define ANSI_C_CYAN   "\e[1;36m"
 

Definition at line 317 of file nanomud.h.

#define ANSI_C_GREEN   "\e[1;32m"
 

Definition at line 313 of file nanomud.h.

#define ANSI_C_GREY   "\e[1;30m"
 

Definition at line 311 of file nanomud.h.

#define ANSI_C_MAGENTA   "\e[1;35m"
 

Definition at line 316 of file nanomud.h.

#define ANSI_C_RED   "\e[1;31m"
 

Definition at line 312 of file nanomud.h.

#define ANSI_C_WHITE   "\e[1;37m"
 

Definition at line 318 of file nanomud.h.

#define ANSI_C_YELLOW   "\e[1;33m"
 

Definition at line 314 of file nanomud.h.

#define ANSI_CLEAR   "\e[0m"
 

Definition at line 303 of file nanomud.h.

#define ANSI_CYAN   "\e[0;36m"
 

Definition at line 309 of file nanomud.h.

#define ANSI_GREEN   "\e[0;32m"
 

Definition at line 305 of file nanomud.h.

#define ANSI_MAGENTA   "\e[0;35m"
 

Definition at line 308 of file nanomud.h.

#define ANSI_RED   "\e[0;31m"
 

Definition at line 304 of file nanomud.h.

#define ANSI_WHITE   "\e[0;37m"
 

Definition at line 310 of file nanomud.h.

#define ANSI_YELLOW   "\e[0;33m"
 

Definition at line 306 of file nanomud.h.

Referenced by handle_input().

#define AO   245
 

Definition at line 377 of file nanomud.h.

#define AT_BLINK   4
 

Definition at line 155 of file nanomud.h.

#define AT_LINK   8
 

Definition at line 156 of file nanomud.h.

#define AT_NONE   0
 

Definition at line 152 of file nanomud.h.

#define AT_REVERSE   2
 

Definition at line 154 of file nanomud.h.

#define AT_UNDERLINE   1
 

Definition at line 153 of file nanomud.h.

#define AYT   246
 

Definition at line 376 of file nanomud.h.

#define BG_MASK   0x00F00000UL
 

Definition at line 27 of file nanomud.h.

#define BG_SHIFT   20
 

Definition at line 30 of file nanomud.h.

#define BLACK   4
 

Definition at line 285 of file nanomud.h.

Referenced by FlushBuffer(), log_html(), set_mouse_pos(), and WindowProcedure().

#define BLUE   2
 

Definition at line 283 of file nanomud.h.

Referenced by FlushBuffer(), and log_html().

#define BMASK   0x70
 

Definition at line 263 of file nanomud.h.

#define BOOL   short unsigned int
 

Definition at line 44 of file nanomud.h.

Referenced by check_alias(), check_path(), do_if(), is_function_internal(), is_operator(), left_token(), parse_ansi(), ParseLines(), right_token(), simple_str_match(), str_search(), string_compare(), and wraps().

#define bool   short unsigned int
 

Definition at line 42 of file nanomud.h.

#define BREAK   243
 

Definition at line 379 of file nanomud.h.

#define BRIGHT   0x01000000UL
 

Definition at line 29 of file nanomud.h.

#define C_BLACK   12
 

Definition at line 293 of file nanomud.h.

Referenced by FlushBuffer(), and log_html().

#define C_BLUE   10
 

Definition at line 291 of file nanomud.h.

Referenced by FlushBuffer(), and log_html().

#define C_CYAN   14
 

Definition at line 295 of file nanomud.h.

Referenced by FlushBuffer(), and log_html().

#define C_GREEN   11
 

Definition at line 292 of file nanomud.h.

Referenced by FlushBuffer(), and log_html().

#define C_MAGENTA   15
 

Definition at line 296 of file nanomud.h.

Referenced by FlushBuffer(), and log_html().

#define C_RED   9
 

Definition at line 290 of file nanomud.h.

Referenced by FlushBuffer(), and log_html().

#define C_WHITE   16
 

Definition at line 297 of file nanomud.h.

Referenced by FlushBuffer(), and log_html().

#define C_YELLOW   13
 

Definition at line 294 of file nanomud.h.

Referenced by FlushBuffer(), and log_html().

#define CYAN   6
 

Definition at line 287 of file nanomud.h.

Referenced by FlushBuffer(), and log_html().

#define DEBUG_FILE   "debug1.txt"
 

Definition at line 119 of file nanomud.h.

Referenced by write_buffer().

#define DEFAULT   0x00980000UL
 

Definition at line 26 of file nanomud.h.

#define DM   242
 

Definition at line 380 of file nanomud.h.

#define DO   253
 

Definition at line 369 of file nanomud.h.

#define DONT   254
 

Definition at line 368 of file nanomud.h.

#define EC   247
 

Definition at line 375 of file nanomud.h.

#define EL   248
 

Definition at line 374 of file nanomud.h.

#define EOR   239
 

Definition at line 383 of file nanomud.h.

#define FALSE   0
 

Definition at line 40 of file nanomud.h.

Referenced by add_term(), check_string(), do_update_paint(), handle_aliases(), handle_path(), handle_triggers(), HandleWinsockConnection(), ParseLines(), save_aliases(), save_macros(), save_paths(), save_scripts(), save_triggers(), save_vars(), update_term(), and write_buffer().

#define FG_MASK   0x000F0000UL
 

Definition at line 28 of file nanomud.h.

#define FG_SHIFT   16
 

Definition at line 31 of file nanomud.h.

#define FMASK   0x07
 

Definition at line 262 of file nanomud.h.

#define free  )     nano_free (x, __FILE__, __LINE__)
 

Definition at line 126 of file nanomud.h.

Referenced by check_output(), FreeTerm(), log_html(), nano_free(), parse_script(), ParseLines(), replace_line(), and safefree().

#define GA   249
 

Definition at line 373 of file nanomud.h.

#define GET_BMASK   (a) ((a) & 0x70) >> 4)
 

Definition at line 267 of file nanomud.h.

#define GET_FMASK   (a) ((a) & 0x07)
 

Definition at line 266 of file nanomud.h.

#define GREEN   3
 

Definition at line 284 of file nanomud.h.

Referenced by FlushBuffer(), and log_html().

#define GREY   17
 

Definition at line 298 of file nanomud.h.

Referenced by add_term(), FlushBuffer(), log_html(), and ParseLines().

#define handle_except a,
b,
c,
 )     _except_handler(a,b,c,d, __FILE__, __LINE__)
 

Definition at line 500 of file nanomud.h.

#define html_log   "mudlog.html"
 

Definition at line 148 of file nanomud.h.

Referenced by log_html(), and WinMain().

#define IAC   255
 

Definition at line 367 of file nanomud.h.

#define ICMP_ECHOREPLY   0
 

Definition at line 450 of file nanomud.h.

#define ICMP_ECHOREQ   8
 

Definition at line 451 of file nanomud.h.

#define ID_ABOUT_OK_BUTTON   1200
 

Definition at line 88 of file nanomud.h.

Referenced by AboutProcedure().

#define ID_CONFIG_COLOR   1601
 

Definition at line 96 of file nanomud.h.

Referenced by SettingsProcedure(), and SetupSettingDialog().

#define ID_CONFIG_EA   1606
 

Definition at line 101 of file nanomud.h.

Referenced by SettingsProcedure(), and SetupSettingDialog().

#define ID_CONFIG_EB   1614
 

Definition at line 109 of file nanomud.h.

Referenced by SettingsProcedure(), and SetupSettingDialog().

#define ID_CONFIG_ECC   1611
 

Definition at line 106 of file nanomud.h.

Referenced by SettingsProcedure(), and SetupSettingDialog().

#define ID_CONFIG_EM   1609
 

Definition at line 104 of file nanomud.h.

Referenced by SettingsProcedure(), and SetupSettingDialog().

#define ID_CONFIG_EP   1608
 

Definition at line 103 of file nanomud.h.

Referenced by SettingsProcedure(), and SetupSettingDialog().

#define ID_CONFIG_EPP   1612
 

Definition at line 107 of file nanomud.h.

Referenced by SettingsProcedure(), and SetupSettingDialog().

#define ID_CONFIG_ES   1605
 

Definition at line 100 of file nanomud.h.

Referenced by SettingsProcedure(), and SetupSettingDialog().

#define ID_CONFIG_ESS   1610