cctools
Functions
catalog_query.h File Reference

Query the global catalog server for server descriptions. More...

#include <time.h>
#include "nvpair.h"

Go to the source code of this file.

Functions

struct catalog_query * catalog_query_create (const char *host, int port, time_t stoptime)
 Create a catalog query.
struct nvpair * catalog_query_read (struct catalog_query *q, time_t stoptime)
 Read the next object from a query.
void catalog_query_delete (struct catalog_query *q)
 Delete a completed query object.

Detailed Description

Query the global catalog server for server descriptions.

Function Documentation

struct catalog_query* catalog_query_create ( const char *  host,
int  port,
time_t  stoptime 
)
read

Create a catalog query.

Connects to a catalog server, issues a query, and waits for the results. The caller may specify a specific catalog host and port. If none is given, then the environment variables CATALOG_HOST and CATALOG_PORT will be consulted. If neither is set, the system will contact chirp.cse.nd.edu on port 9097.

Parameters
hostThe catalog server to query, or null for the default server.
portThe port of the server, or 0 for the default port.
stoptimeThe absolute time at which to abort.
Returns
A catalog query object on success, or null on failure.
struct nvpair* catalog_query_read ( struct catalog_query *  q,
time_t  stoptime 
)
read

Read the next object from a query.

Returns the next nvpair.h object from the issued query. The caller may nvpair_lookup_string or nvpair_lookup_integer to examine the object, and then must call nvpair_delete when done.

Parameters
qA query created by catalog_query_create.
stoptimeThe absolute time at which to abort.
Returns
An nvpair.h object representing the next result, or null if the end of stream has been reached.
void catalog_query_delete ( struct catalog_query *  q)

Delete a completed query object.

Parameters
qThe query to delete.