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 |
void | print () const |
Static Public Member Functions | |
static bool | getNumber (const char *name, int32_t *number) |
static bool | getAliasList (const char *name, char ***aliaslist) |
static bool | getName (int32_t number, char **name) |
static bool | getAliasList (int32_t number, char ***aliaslist) |
static bool | needsMutex () |
static void | setMutex (mutex *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.
static bool rpcentry::getAliasList | ( | const char * | name, |
char *** | aliaslist | ||
) | [static] |
Sets "aliaslist" to a NULL-terminated list of aliases for rpc "name". Note that "aliaslist" is allocated internally and returned. The calling program must free each element and the array itself.
Returns true on success and false otherwise.
static bool rpcentry::getAliasList | ( | int32_t | number, |
char *** | aliaslist | ||
) | [static] |
Sets "aliaslist" to a NULL-terminated list of aliases for rpc "number". Note that "aliaslist" is allocated internally and returned. The calling program must free each element and the array itself.
Returns true on success and false otherwise.
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 bool rpcentry::getName | ( | int32_t | number, |
char ** | name | ||
) | [static] |
Sets "name" to the name associated with rpc "number".
Returns true on success and false otherwise.
static bool rpcentry::getNumber | ( | const char * | name, |
int32_t * | number | ||
) | [static] |
Sets "number" to the number associated with rpc "name".
Returns true on success and false otherwise.
int32_t rpcentry::getNumber | ( | ) | const |
Returns the number of the rpc entry.
bool rpcentry::initialize | ( | int32_t | number | ) |
Looks up a rpc entry by number. Returns true on success and false on failure.
bool rpcentry::initialize | ( | const char * | name | ) |
Looks up a rpc entry by name. Returns true on success and false on failure.
static bool rpcentry::needsMutex | ( | ) | [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".
void rpcentry::print | ( | ) | const |
Prints out a representation of the rpc entry.
static void rpcentry::setMutex | ( | mutex * | mtx | ) | [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.