catalog_query.h
Go to the documentation of this file.
/*
Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
Copyright (C) 2022 The University of Notre Dame
This software is distributed under the GNU General Public License.
See the file COPYING for details.
*/
#ifndef CATALOG_QUERY_H
#define CATALOG_QUERY_H
#include <time.h>
#include "jx.h"
#define CATALOG_HOST_DEFAULT "catalog.cse.nd.edu,backup-catalog.cse.nd.edu"
#define CATALOG_PORT_DEFAULT 9097
#define CATALOG_HOST (getenv("CATALOG_HOST") ? getenv("CATALOG_HOST") : CATALOG_HOST_DEFAULT )
#define CATALOG_PORT (getenv("CATALOG_PORT") ? atoi(getenv("CATALOG_PORT")) : CATALOG_PORT_DEFAULT )
typedef enum {
CATALOG_UPDATE_BACKGROUND=1,
CATALOG_UPDATE_CONDITIONAL=2,
} catalog_update_flags_t;
struct catalog_query *catalog_query_create(const char *hosts, struct jx *filter_expr, time_t stoptime);
struct jx *catalog_query_read(struct catalog_query *q, time_t stoptime);
void catalog_query_delete(struct catalog_query *q);
int catalog_query_send_update(const char *hosts, const char *text, catalog_update_flags_t flags );
#endif
catalog_query_create
struct catalog_query * catalog_query_create(const char *hosts, struct jx *filter_expr, time_t stoptime)
Create a catalog query.
catalog_update_flags_t
catalog_update_flags_t
Catalog update control flags.
Definition catalog_query.h:27
CATALOG_UPDATE_BACKGROUND
@ CATALOG_UPDATE_BACKGROUND
Send update via a background process if TCP is selected.
Definition catalog_query.h:28
CATALOG_UPDATE_CONDITIONAL
@ CATALOG_UPDATE_CONDITIONAL
Fail if UDP is selected and update is too large to send.
Definition catalog_query.h:29
catalog_query_read
struct jx * catalog_query_read(struct catalog_query *q, time_t stoptime)
Read the next object from a query.
catalog_query_send_update
int catalog_query_send_update(const char *hosts, const char *text, catalog_update_flags_t flags)
Send update text to the given hosts hosts is a comma delimited list of hosts, each of which can be ho...
catalog_query_delete
void catalog_query_delete(struct catalog_query *q)
Delete a completed query object.
jx.h
JSON Expressions (JX) library.
jx
JX value representing any expression type.
Definition jx.h:117