Rudiments
|
00001 // Copyright (c) 2002 David Muse 00002 // See the COPYING file for more information. 00003 00004 #ifndef RUDIMENTS_HOSTENTRY_H 00005 #define RUDIMENTS_HOSTENTRY_H 00006 00007 #include <rudiments/private/hostentryincludes.h> 00008 00009 #ifdef RUDIMENTS_NAMESPACE 00010 namespace rudiments { 00011 #endif 00012 00013 class hostentryprivate; 00014 00017 class RUDIMENTS_DLLSPEC hostentry { 00018 public: 00019 00026 static bool getAliasList(const char *hostname, 00027 char ***aliaslist); 00028 00030 static bool getAddressType(const char *hostname, 00031 int32_t *addresstype); 00032 00035 static bool getAddressLength(const char *hostname, 00036 int32_t *addresslength); 00037 00046 static bool getAddressList(const char *hostname, 00047 char ***addresslist); 00048 00053 static bool getAddressString(const char *hostname, 00054 int32_t index, 00055 char **addressstring); 00056 00065 static bool getName(const char *address, 00066 int32_t len, int32_t type, 00067 char **name); 00068 00078 static bool getAliasList(const char *address, 00079 int32_t len, int32_t type, 00080 char ***aliaslist); 00081 00091 static bool getAddressList(const char *address, 00092 int32_t len, int32_t type, 00093 char ***addresslist); 00094 00103 static bool getAddressString(const char *address, 00104 int32_t len, int32_t type, 00105 int32_t index, 00106 char **addressstring); 00107 00109 hostentry(); 00110 00113 hostentry(const hostentry &h); 00114 00117 hostentry &operator=(const hostentry &h); 00118 00120 ~hostentry(); 00121 00123 bool initialize(const char *hostname); 00124 00129 bool initialize(const char *address, 00130 int32_t len, int32_t type); 00131 00133 const char *getName() const; 00134 00137 const char * const *getAliasList() const; 00138 00140 int32_t getAddressType() const; 00141 00143 int32_t getAddressLength() const; 00144 00147 const char * const *getAddressList() const; 00148 00153 char *getAddressString(int32_t index) const; 00154 00156 void print() const; 00157 00160 static bool needsMutex(); 00161 00165 static void setMutex(mutex *mtx); 00166 00167 #include <rudiments/private/hostentry.h> 00168 }; 00169 00170 #ifdef RUDIMENTS_NAMESPACE 00171 } 00172 #endif 00173 00174 #endif