Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

StaticFunctions.cpp File Reference

#include "headers.h"

Go to the source code of this file.

Functions

tm * threadsafe_gmtime (const time_t *timer)
int threadsafe_gethostbyname (struct hostent *he, const char *name)
 A wrapper around the unthreadsafe function "gethostbyname". More...

int threadsafe_gethostbyaddr (struct hostent *he, const char *addr, int len, int type)
 A wrapper around the unthreadsafe function "gethostbyaddr". More...

char * threadsafe_inet_ntoa (struct in_addr in)
unsigned int getPortFromSocket (OS_SPEC_SOCKET_TYPE sock)
 Return the port that the socket is listening on, in standard decimal form. More...

char * boolToString (bool val)
 Convert a bool value to a string and return the string. More...

bool stringToBool (string value)
 Return a boolean value given a string of "true" or "false" (case-insensitive). More...

char * printWsaErrorCode ()
 Return the last windows error code as a string and reset the error state. More...


Variables

Mutex g_gmtimeLock
Mutex g_getHostLock
Mutex g_inetNtoaLock


Function Documentation

char* boolToString bool val
 

Convert a bool value to a string and return the string.

Definition at line 81 of file StaticFunctions.cpp.

unsigned int getPortFromSocket OS_SPEC_SOCKET_TYPE sock
 

Return the port that the socket is listening on, in standard decimal form.

Definition at line 69 of file StaticFunctions.cpp.

char* printWsaErrorCode
 

Return the last windows error code as a string and reset the error state.

Definition at line 109 of file StaticFunctions.cpp.

Referenced by TcpConnection::accept(), TcpConnection::connect(), TcpConnection::createListeningSocket(), LinkLayerInterface::pollAllSocketsImpl(), TcpConnection::read(), NpPacket::read(), TcpConnection::write(), and SslConnection::write().

bool stringToBool std::string val
 

Return a boolean value given a string of "true" or "false" (case-insensitive).

Definition at line 95 of file StaticFunctions.cpp.

int threadsafe_gethostbyaddr struct hostent * he,
const char * addr,
int len,
int type
 

A wrapper around the unthreadsafe function "gethostbyaddr".

Returns:
0 on failure (unable to convert name to DNS entry) 1 on success

Definition at line 45 of file StaticFunctions.cpp.

int threadsafe_gethostbyname struct hostent * he,
const char * name
 

A wrapper around the unthreadsafe function "gethostbyname".

Returns:
0 on failure (unable to convert name to DNS entry) 1 on success

Definition at line 26 of file StaticFunctions.cpp.

struct tm* threadsafe_gmtime const time_t * timer
 

Definition at line 14 of file StaticFunctions.cpp.

char* threadsafe_inet_ntoa struct in_addr in
 

Definition at line 59 of file StaticFunctions.cpp.


Variable Documentation

Mutex g_getHostLock [static]
 

Definition at line 10 of file StaticFunctions.cpp.

Mutex g_gmtimeLock [static]
 

Definition at line 9 of file StaticFunctions.cpp.

Mutex g_inetNtoaLock [static]
 

Definition at line 11 of file StaticFunctions.cpp.


Generated at Thu Jul 11 13:31:54 2002 for Peekabooty by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001