#include <time.h>
#include "jx.h"
Go to the source code of this file.
Functions | |
catalog_query * | catalog_query_create (const char *host, int port, time_t stoptime) |
Create a catalog query. | |
jx * | 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. |
struct catalog_query* catalog_query_create | ( | const char * | host, | |
int | port, | |||
time_t | stoptime | |||
) |
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.
host | The catalog server to query, or null for the default server. | |
port | The port of the server, or 0 for the default port. | |
stoptime | The absolute time at which to abort. |
struct jx* catalog_query_read | ( | struct catalog_query * | q, | |
time_t | stoptime | |||
) |
Read the next object from a query.
Returns the next jx expressions from the issued query. The caller may use jx_lookup_string, jx_lookup_integer and related functions to manipulate the object, and then must call jx_delete when done.
q | A query created by catalog_query_create. | |
stoptime | The absolute time at which to abort. |
void catalog_query_delete | ( | struct catalog_query * | q | ) |
Delete a completed query object.
q | The query to delete. |