cctools
catalog_query.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
3 Copyright (C) 2005- The University of Notre Dame
4 This software is distributed under the GNU General Public License.
5 See the file COPYING for details.
6 */
7 #ifndef CATALOG_QUERY_H
8 #define CATALOG_QUERY_H
9 
10 #include <time.h>
11 #include "jx.h"
12 
17 #define CATALOG_HOST_DEFAULT "catalog.cse.nd.edu,backup-catalog.cse.nd.edu"
18 #define CATALOG_PORT_DEFAULT 9097
19 
20 #define CATALOG_HOST (getenv("CATALOG_HOST") ? getenv("CATALOG_HOST") : CATALOG_HOST_DEFAULT )
21 #define CATALOG_PORT (getenv("CATALOG_PORT") ? atoi(getenv("CATALOG_PORT")) : CATALOG_PORT_DEFAULT )
22 
34 struct catalog_query *catalog_query_create(const char *hosts, struct jx *filter_expr, time_t stoptime);
35 
45 struct jx *catalog_query_read(struct catalog_query *q, time_t stoptime);
46 
50 void catalog_query_delete(struct catalog_query *q);
51 
58 int catalog_query_send_update(const char *hosts, const char *text);
59 
66 int catalog_query_send_update_conditional(const char *hosts, const char *text);
67 
68 #endif
struct jx * catalog_query_read(struct catalog_query *q, time_t stoptime)
Read the next object from a query.
struct catalog_query * catalog_query_create(const char *hosts, struct jx *filter_expr, time_t stoptime)
Create a catalog query.
JSON Expressions (JX) library.
int catalog_query_send_update_conditional(const char *hosts, const char *text)
Send update text to the given hosts, but fail if the update text cannot be compressed to a suitable ...
JX value representing any expression type.
Definition: jx.h:117
int catalog_query_send_update(const char *hosts, const char *text)
Send update text to the given hosts hosts is a comma delimited list of hosts, each of which can be h...
void catalog_query_delete(struct catalog_query *q)
Delete a completed query object.