pazpar2  1.13.0
Go to the documentation of this file.
1 /* This file is part of Pazpar2.
2  Copyright (C) Index Data
4 Pazpar2 is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
7 version.
9 Pazpar2 is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
24 #ifndef CLIENT_H
25 #define CLIENT_H
27 #include "facet_limit.h"
28 #include "reclists.h"
30 struct client;
31 struct connection;
34 {
41 };
43 int clients_get_count(void);
44 int client_show_raw_begin(struct client *cl, int position,
45  const char *syntax, const char *esn,
46  void *data,
47  void (*error_handler)(void *data, const char *addinfo),
48  void (*record_handler)(void *data, const char *buf,
49  size_t sz),
50  int binary,
51  const char *nativesyntax);
53 void client_show_raw_remove(struct client *cl, void *rr);
55 const char *client_get_state_str(struct client *cl);
56 enum client_state client_get_state(struct client *cl);
57 void client_set_state(struct client *cl, enum client_state st);
58 void client_set_state_nb(struct client *cl, enum client_state st);
59 struct connection *client_get_connection(struct client *cl);
60 struct session_database *client_get_database(struct client *cl);
61 void client_set_database(struct client *cl, struct session_database *db);
62 struct session *client_get_session(struct client *cl);
64 void client_search_response(struct client *cl);
65 void client_record_response(struct client *cl, int *got_records);
67 struct client *client_create(const char *url);
68 int client_destroy(struct client *c);
70 void client_set_connection(struct client *cl, struct connection *con);
71 void client_disconnect(struct client *cl);
72 void client_mark_dead(struct client *cl);
73 int client_prep_connection(struct client *cl,
74  int operation_timeout, int session_timeout,
76  const struct timeval *abstime);
77 int client_start_search(struct client *cl);
78 int client_fetch_more(struct client *cl);
79 int client_parse_init(struct client *cl, int same_search);
80 int client_parse_range(struct client *cl, const char *startrecs, const char *maxrecs);
81 int client_parse_sort(struct client *cl, struct reclist_sortparms *sp,
82  int *has_sortmap);
83 void client_set_session(struct client *cl, struct session *se);
84 int client_is_active(struct client *cl);
85 int client_is_active_preferred(struct client *cl);
86 struct client *client_next_in_session(struct client *cl);
88 int client_parse_query(struct client *cl, const char *query,
89  facet_limits_t facet_limits, const char **error_msg);
90 Odr_int client_get_hits(struct client *cl);
91 Odr_int client_get_approximation(struct client *cl);
92 int client_get_num_records(struct client *cl, int *filtered, int *ingest,
93  int *failed);
94 int client_get_diagnostic(struct client *cl,
95  const char **message, const char **addinfo);
96 void client_set_diagnostic(struct client *cl, int diagnostic,
97  const char *message, const char *addinfo);
98 void client_set_database(struct client *cl, struct session_database *db);
99 const char *client_get_id(struct client *cl);
100 int client_get_maxrecs(struct client *cl);
101 void client_remove_from_session(struct client *c);
102 void client_incref(struct client *c);
103 void client_got_records(struct client *c);
104 void client_lock(struct client *c);
105 void client_unlock(struct client *c);
106 void client_stop(struct client *c);
108 int client_has_facet(struct client *cl, const char *name);
109 int client_reingest(struct client *cl);
110 const char *client_get_facet_limit_local(struct client *cl,
111  struct session_database *sdb,
112  int *l,
113  NMEM nmem, int *num, char ***values);
115 const char *client_get_suggestions_xml(struct client *cl, WRBUF wrbuf);
117 void client_update_show_stat(struct client *cl, int cmd);
119 void client_store_xdoc(struct client *cl, int record_no, xmlDoc *xdoc);
121 const char *client_get_query(struct client *cl, const char **type, NMEM nmem);
123 #endif
125 /*
126  * Local variables:
127  * c-basic-offset: 4
128  * c-file-style: "Stroustrup"
129  * indent-tabs-mode: nil
130  * End:
131  * vim: shiftwidth=4 tabstop=8 expandtab
132  */
void client_set_connection(struct client *cl, struct connection *con)
Definition: client.c:1144
void client_unlock(struct client *c)
Definition: client.c:1096
int client_reingest(struct client *cl)
Definition: client.c:732
int client_get_maxrecs(struct client *cl)
Definition: client.c:1838
int client_destroy(struct client *c)
Definition: client.c:1108
void client_update_show_stat(struct client *cl, int cmd)
Definition: client.c:814
int client_has_facet(struct client *cl, const char *name)
Definition: client.c:773
int client_fetch_more(struct client *cl)
Definition: client.c:822
int same_search
Definition: client.c:125
void client_set_database(struct client *cl, struct session_database *db)
Definition: client.c:1828
void client_set_session(struct client *cl, struct session *se)
Definition: client.c:1721
enum client_state client_get_state(struct client *cl)
Definition: client.c:166
int clients_get_count(void)
Definition: client.c:93
struct session * client_get_session(struct client *cl)
Definition: client.c:256
Odr_int client_get_approximation(struct client *cl)
Definition: client.c:1751
struct client * client_next_in_session(struct client *cl)
const char * client_get_id(struct client *cl)
Definition: client.c:1833
int client_prep_connection(struct client *cl, int operation_timeout, int session_timeout, iochan_man_t iochan, const struct timeval *abstime)
Definition: connection.c:471
int client_parse_sort(struct client *cl, struct reclist_sortparms *sp, int *has_sortmap)
Definition: client.c:1654
int client_show_raw_begin(struct client *cl, int position, const char *syntax, const char *esn, void *data, void(*error_handler)(void *data, const char *addinfo), void(*record_handler)(void *data, const char *buf, size_t sz), int binary, const char *nativesyntax)
Definition: client.c:299
int client_parse_init(struct client *cl, int same_search)
Definition: client.c:867
void client_got_records(struct client *c)
Definition: client.c:580
void client_set_diagnostic(struct client *cl, int diagnostic, const char *message, const char *addinfo)
Definition: client.c:1777
Represents a physical, reusable connection to a remote Z39.50 host.
Definition: connection.c:88
char * name
int client_is_active(struct client *cl)
Definition: client.c:1726
int client_parse_query(struct client *cl, const char *query, facet_limits_t facet_limits, const char **error_msg)
Definition: client.c:1502
const char * client_get_facet_limit_local(struct client *cl, struct session_database *sdb, int *l, NMEM nmem, int *num, char ***values)
Definition: client.c:1289
struct client * client_create(const char *url)
Definition: client.c:1055
Odr_int client_get_hits(struct client *cl)
Definition: client.c:1746
Represents client state for a connection to one search target.
Definition: client.c:99
int maxrecs
Definition: client.c:112
int diagnostic
Definition: client.c:114
int client_is_active_preferred(struct client *cl)
Definition: client.c:1734
const char * client_get_state_str(struct client *cl)
Definition: client.c:161
void client_record_response(struct client *cl, int *got_records)
Definition: client.c:693
struct connection * client_get_connection(struct client *cl)
Definition: client.c:246
void client_set_state(struct client *cl, enum client_state st)
Definition: client.c:176
void client_incref(struct client *c)
Definition: client.c:1101
int client_get_num_records(struct client *cl, int *filtered, int *ingest, int *failed)
Definition: client.c:1765
void client_lock(struct client *c)
Definition: client.c:1091
int startrecs
Definition: client.c:113
int client_start_search(struct client *cl)
Definition: client.c:910
char * message
Definition: client.c:115
int client_parse_range(struct client *cl, const char *startrecs, const char *maxrecs)
Definition: client.c:876
void client_store_xdoc(struct client *cl, int record_no, xmlDoc *xdoc)
Definition: client.c:228
void client_remove_from_session(struct client *c)
void client_disconnect(struct client *cl)
Definition: client.c:1163
struct session_database * client_get_database(struct client *cl)
Definition: client.c:251
Definition: eventl.h:31
xmlDoc ** xdoc
Definition: client.c:128
void client_search_response(struct client *cl)
Definition: client.c:549
void client_mark_dead(struct client *cl)
Definition: client.c:1170
const char * client_get_query(struct client *cl, const char **type, NMEM nmem)
Definition: client.c:894
int client_get_diagnostic(struct client *cl, const char **message, const char **addinfo)
Definition: client.c:1789
const char * client_get_suggestions_xml(struct client *cl, WRBUF wrbuf)
Definition: client.c:1799
void client_set_state_nb(struct client *cl, enum client_state st)
Definition: client.c:171
Definition: client.h:33
static void session_timeout(IOCHAN i, int event)
Definition: http_command.c:128
void client_stop(struct client *c)
Definition: client.c:1176
int filtered
Definition: client.c:109
void client_show_raw_remove(struct client *cl, void *rr)
Definition: client.c:381