From 2fffc25ea8895cbd7748b4a84565091a91490995 Mon Sep 17 00:00:00 2001 From: skotlex Date: Wed, 21 Jun 2006 18:30:39 +0000 Subject: - Added function parse_hostbyname() which takes a hostname and a char[4]. The hostname is resolved to an ip, whose individual components are stored in char[], the return value of the function is the inet_addr result of the lookup (or returns 0 when failed). Meant to be used in the rest of the code without the need to do socket/network related includes. - Applied use of parse_hostbyname() in chrif.c to fix compilation errors. - status_percent_change will now account for when the target's max hp/sp is above INT_MAX. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7281 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/common/socket.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/common/socket.h') diff --git a/src/common/socket.h b/src/common/socket.h index a6a0fb191..01165126e 100644 --- a/src/common/socket.h +++ b/src/common/socket.h @@ -154,6 +154,11 @@ int start_console(void); void set_defaultparse(int (*defaultparse)(int)); void set_defaultconsoleparse(int (*defaultparse)(char*)); +//Resolves the hostname and stores the string representation of the string in ip. +//Meant to simplify calls to gethostbyname without the need of all the +//required network includes. +int resolve_hostbyname(char* hostname, char *ip); + extern unsigned int addr_[16]; // ip addresses of local host (host byte order) extern unsigned int naddr_; // # of ip addresses -- cgit v1.2.3-70-g09d2