Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

SRC/misc.h File Reference


Detailed Description

Definition in file misc.h.

Go to the source code of this file.

Data Structures

struct  search_list
struct  DPMI_regs
struct  IREGS

Typedefs

typedef DPMI_regs IREGS
typedef INTR_PROTOTYPE(* W32_IntrHandler )()

Functions

W32_FUNC void init_misc (void)
 Initialise various stuff.
W32_FUNC void exit_misc (void)
 Called from sock_exit() to clear up things done here.
W32_FUNC unsigned Random (unsigned a, unsigned b)
 Returns a random integer in range [a..b].
W32_FUNC void RandomWait (unsigned msec_a, unsigned msec_b)
 Wait for a random period in range [a..b] millisec.
W32_FUNC void Wait (unsigned msec)
 Not all vendors have delay().
W32_FUNC BOOL valid_addr (const void *addr, unsigned len)
W32_FUNC BOOL is_in_stack (const void *ptr)
W32_FUNC unsigned used_stack (void)
W32_FUNC void os_yield (void)
W32_FUNC BOOL watt_kbhit (void)
 A less CPU hogging kbhit().
DWORD get_day_num (void)
 Simplified method of getting days since 1970-01-01.
BOOL shell_exec (const char *cmd)
BOOL get_mem_strat (BYTE *strat)
BOOL set_mem_strat (BYTE strat)
void memdbg_init (void)
int rundown_add (void(*func)(void), const char *name, int order, const char *file, unsigned line)
 Register a function to be called from sock_exit().
void rundown_run (void)
 Run the registered and sorted exit_list[] functions.
void rundown_dump (void)
 Dump 'exit_list[]' list.
FILE * fopen_excl (const char *file, const char *mode)
 WIN32: Open an existing file (or create) in share-mode but deny other processes to write to the file.
const char * dos_extender_name (void)
void assert_fail (const char *file, unsigned line, const char *what)
 Print an assert fail and store the text for later.
const char * dword_str (DWORD val)
 Return nicely formatted string "xx,xxx,xxx" with thousand separators (left adjusted).
const char * list_lookup (DWORD, const struct search_list *, int)
 Search 'list' for 'type' and return it's name.
const char * list_lookupX (DWORD, const struct search_list *, int)
const char * MAC_address (const void *addr)
 Return hexa-decimal string for an 6/7 byte MAC-address.
void unfinished (const char *func, const char *file, unsigned line)
void watt_large_check (const void *sock, int size, const char *file, unsigned line)
BOOL init_winmisc (void)
char * win_strerror (DWORD err)
void assert_fail_win (const char *file, unsigned line, const char *what)
BOOL WinDnsQuery_A4 (const char *name, DWORD *ip4)
BOOL WinDnsQuery_A6 (const char *name, void *ip6)
BOOL WinDnsQuery_PTR4 (DWORD ip4, char *name, size_t size)
BOOL WinDnsQuery_PTR6 (const void *ip6, char *name, size_t size)
BOOL WinDnsCachePut_A4 (const char *name, DWORD ip4)
BOOL WinDnsCachePut_A6 (const char *name, const void *ip6)
W32_FUNC int tcp_cbreak (int mode)
 Sets our break mode.
int set_cbreak (int want_brk)
 Sets normal and extended BREAK mode.
void MS_CDECL sig_handler_watt (int sig)
 SIGINT/SIGBREAK handler function.
int GetCountryCode (void)
int GetCodePage (void)
void int24_init (void)
void int24_restore (void)
void dputch (char x)
void dmsg (const char *s)
void dhex1int (int x)
void dhex2int (int x)
void dhex4int (int x)
void dhex8int (DWORD x)
W32_FUNC const char * wattcpVersion (void)
W32_FUNC const char * wattcpCapabilities (void)
BOOL crc_init (void)
DWORD crc_bytes (const char *buf, size_t len)
const char * short_strerror (int errnum)
void intr (int int_no, IREGS *regs)
void STACK_SET (void far *stack)
void STACK_RESTORE (void)
void PUSHF_CLI (void)
void POPF (void)
void STACK_SET (void *stack)
WORD watcom_MY_CS (void)
WORD watcom_MY_DS (void)
DWORD GET_LIMIT (WORD sel)
DWORD get_ds_limit (void)
DWORD get_cs_limit (void)
DWORD get_ss_limit (void)
typedef void (cdecl interrupt *W32_IntrHandler)()
__inline__ WORD get_fs_reg (void)
__inline__ WORD get_gs_reg (void)
__inline__ void set_fs_reg (WORD sel)
__inline__ void set_gs_reg (WORD sel)
char * strupr (char *)
char * strlwr (char *)
char * strdup (const char *)
int stricmp (const char *, const char *)
int strnicmp (const char *, const char *, size_t)
char * itoa (int, char *, int)
void * alloca (size_t)
int gettimeofday (struct timeval *, struct timezone *)
int fileno (FILE *)
int isascii (int)
void psignal (int, const char *)
int vsscanf (const char *, const char *, va_list)

Variables

W32_DATA int __bss_count
const char hex_chars_lower []
const char hex_chars_upper []
W32_DATA BOOL win32_dos_box
W32_DATA BOOL _watt_fatal_error
W32_DATA WORD _watt_os_ver
W32_DATA char _watt_assert_buf [256]
BOOL _watt_is_win9x
W32_DATA WORD _watt_handle_cbreak
W32_DATA volatile int _watt_cbroke
BYTE dbg_colour
WORD dbg_scrpos
WORD dbg_scrstart
W32_DATA const char * wattcpCopyright
int pull_neterr_module


Function Documentation

FILE* fopen_excl const char *  file,
const char *  mode
 

WIN32: Open an existing file (or create) in share-mode but deny other processes to write to the file.

On Watcom, fopen() already seems to open with SH_DENYWR internally. DOS/Watcom: simply call fopen(). Definition at line 441 of file misc.c.

DWORD get_day_num void   ) 
 

Simplified method of getting days since 1970-01-01.

Don't use time() since it will probably link in sprintf(). We don't need accuracy. Only a reference for sock_stats(). Definition at line 198 of file misc.c.

References DWORD.

W32_FUNC void init_misc void   ) 
 

Initialise various stuff.

Todo:
Definition at line 322 of file misc.c.

const char* MAC_address const void *  addr  ) 
 

Return hexa-decimal string for an 6/7 byte MAC-address.

Use 2 buffers in round-robin. Definition at line 935 of file misc.c.

References _pktdevclass.

int set_cbreak int  want_brk  ) 
 

Sets normal and extended BREAK mode.

  • want_brk 0x0000: no ^BREAK checking.
  • want_brk 0x0001: normal ^BREAK checks.
  • want_brk 0x0101: extended ^BREAK checks.
Return values:
normal BREAK state in LSB, extended BREAK state in MSB.
Definition at line 110 of file pc_cbrk.c.

References WORD.

W32_FUNC int tcp_cbreak int  mode  ) 
 

Sets our break mode.

  • `mode' is composed of the following flags
    • 0x01: disallow breakouts
    • 0x10: display a message upon ^C/^BREAK (default)
Definition at line 172 of file pc_cbrk.c.

W32_FUNC const char* wattcpVersion void   ) 
 

Todo:
not tested

not tested

Definition at line 333 of file djimport.c.


Generated on Wed Aug 4 08:55:56 2010 for Watt-32 tcp/ip by doxygen 1.3.8