Rudiments
|
Public Member Functions | |
rpcentry () | |
rpcentry (const rpcentry &r) | |
rpcentry & | operator= (const rpcentry &r) |
~rpcentry () | |
bool | initialize (const char *name) |
bool | initialize (int32_t number) |
const char * | getName () const |
int32_t | getNumber () const |
const char *const * | getAliasList () const |
Static Public Member Functions | |
static int32_t | getNumber (const char *name) |
static char * | getName (int32_t number) |
static bool | needsMutex () |
static void | setMutex (threadmutex *mtx) |
The rpcentry class provides methods for retrieving entries from the rpc file (/etc/rpc on unix).
rpcentry::rpcentry | ( | ) |
Creates an instance of the rpcentry class.
rpcentry::rpcentry | ( | const rpcentry & | r | ) |
Creates an instance of the rpcentry class that is identical to "r".
rpcentry::~rpcentry | ( | ) |
Deletes this instance of the rpcentry class.
const char* const* rpcentry::getAliasList | ( | ) | const |
Returns a NULL-terminated list of aliases for the rpc entry.
const char* rpcentry::getName | ( | ) | const |
Returns the name of the rpc entry.
|
static |
Convenience method. Sets "name" to the name associated with rpc "number".
Note that the return value is allocated internally and returned. The calling program must free the buffer.
Returns NULL if an error occurred or if "name" is invalid.
int32_t rpcentry::getNumber | ( | ) | const |
Returns the number of the rpc entry.
|
static |
Convenience method. Sets "number" to the number associated with rpc "name".
Returns -1 if an error occurred or if "name" is invalid.
bool rpcentry::initialize | ( | const char * | name | ) |
Looks up a rpc entry by name. Returns true on success and false on failure.
bool rpcentry::initialize | ( | int32_t | number | ) |
Looks up a rpc entry by number. Returns true on success and false on failure.
|
static |
Returns true if this class needs a mutex to operate safely in a threaded environment and false otherwise.
Makes this instance of the rpcentry class identical ot "r".
|
static |
Allows you to supply a mutex is the class needs it. (see needsMutex()). If your application is not multithreaded, then there is no need to supply a mutex.