* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/* $Id: poll.h,v 1.3 2007-11-09 22:08:14 adam Exp $ */
+/* $Id: poll.h,v 1.4 2007-11-30 11:44:46 adam Exp $ */
/**
* \file
/** \brief select/poll masks .. timeout is "output" only */
enum yaz_poll_mask {
+ yaz_poll_none = 0,
yaz_poll_read = 1,
yaz_poll_write = 2,
yaz_poll_except = 4,
*/
int yaz_poll(struct yaz_poll_fd *fds, int num_fds, int sec, int nsec);
+#define yaz_poll_add(var,value) var = (enum yaz_poll_mask ) ((int) var | value)
YAZ_END_CDECL
#endif
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: comstack.c,v 1.21 2007-10-09 06:00:56 adam Exp $
+ * $Id: comstack.c,v 1.22 2007-11-30 11:44:47 adam Exp $
*/
/**
if (cp)
{
size_t len = cp - (uri + 8);
- *connect_host = xmalloc(len+1);
+ *connect_host = (char *) xmalloc(len+1);
memcpy(*connect_host, uri + 8, len);
(*connect_host)[len] = '\0';
uri = cp+1;
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: eventl.c,v 1.16 2007-11-12 08:41:56 adam Exp $
+ * $Id: eventl.c,v 1.17 2007-11-30 11:44:47 adam Exp $
*/
/**
}
for (p = *iochans; p; p = p->next)
no_fds++;
- fds = xmalloc(no_fds * sizeof(*fds));
+ fds = (struct yaz_poll_fd *) xmalloc(no_fds * sizeof(*fds));
for (i = 0, p = *iochans; p; p = p->next, i++)
{
time_t w, ftime;
- enum yaz_poll_mask input_mask = 0;
+ enum yaz_poll_mask input_mask = yaz_poll_none;
yaz_log(log_level, "fd=%d flags=%d force_event=%d",
p->fd, p->flags, p->force_event);
if (p->force_event)
tv_sec = 0; /* polling select */
if (p->flags & EVENT_INPUT)
- input_mask += yaz_poll_read;
+ yaz_poll_add(input_mask, yaz_poll_read);
if (p->flags & EVENT_OUTPUT)
- input_mask += yaz_poll_write;
+ yaz_poll_add(input_mask, yaz_poll_write);
if (p->flags & EVENT_EXCEPT)
- input_mask += yaz_poll_except;
+ yaz_poll_add(input_mask, yaz_poll_except);
if (p->max_idle && p->last_event)
{
ftime = p->last_event + p->max_idle;
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: http.c,v 1.3 2007-09-06 17:11:59 mike Exp $
+ * $Id: http.c,v 1.4 2007-11-30 11:44:47 adam Exp $
*/
/**
return;
len = strlen(username) + strlen(password);
- tmp = odr_malloc(o, len+2);
+ tmp = (char *) odr_malloc(o, len+2);
sprintf(tmp, "%s:%s", username, password);
- buf = odr_malloc(o, (len+1) * 8/6 + 12);
+ buf = (char *) odr_malloc(o, (len+1) * 8/6 + 12);
strcpy(buf, "Basic ");
yaz_base64encode(tmp, &buf[strlen(buf)]);
z_HTTP_header_add(o, hp, "Authorization", buf);
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: poll.c,v 1.3 2007-11-10 08:59:31 adam Exp $
+ * $Id: poll.c,v 1.4 2007-11-30 11:44:47 adam Exp $
*/
/**
* \file
{
for (i = 0; i < num_fds; i++)
{
- enum yaz_poll_mask mask = 0;
+ enum yaz_poll_mask mask = yaz_poll_none;
int fd = fds[i].fd;
if (!r)
- mask += yaz_poll_timeout;
+ yaz_poll_add(mask, yaz_poll_timeout);
else
{
if (FD_ISSET(fd, &input))
- mask += yaz_poll_read;
+ yaz_poll_add(mask, yaz_poll_read);
if (FD_ISSET(fd, &output))
- mask += yaz_poll_write;
+ yaz_poll_add(mask, yaz_poll_write);
if (FD_ISSET(fd, &except))
- mask += yaz_poll_except;
+ yaz_poll_add(mask, yaz_poll_except);
}
fds[i].output_mask = mask;
}
{
for (i = 0; i < num_fds; i++)
{
- enum yaz_poll_mask mask = 0;
+ enum yaz_poll_mask mask = yaz_poll_none;
if (!r)
- mask += yaz_poll_timeout;
+ yaz_poll_add(mask, yaz_poll_timeout);
else
{
if (pollfds[i].revents & POLLIN)
- mask += yaz_poll_read;
+ yaz_poll_add(mask, yaz_poll_read);
if (pollfds[i].revents & POLLOUT)
- mask += yaz_poll_write;
+ yaz_poll_add(mask, yaz_poll_write);
if (pollfds[i].revents & POLLERR)
- mask += yaz_poll_except;
+ yaz_poll_add(mask, yaz_poll_except);
}
fds[i].output_mask = mask;
}
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: tcpip.c,v 1.37 2007-11-09 21:52:38 adam Exp $
+ * $Id: tcpip.c,v 1.38 2007-11-30 11:44:47 adam Exp $
*/
/**
* \file tcpip.c
if (connect_host)
{
tcpip_state *sp = (tcpip_state *) p->cprivate;
- sp->connect_request_buf = xmalloc(strlen(connect_host) + 30);
+ sp->connect_request_buf = (char *) xmalloc(strlen(connect_host) + 30);
sprintf(sp->connect_request_buf, "CONNECT %s HTTP/1.0\r\n\r\n",
connect_host);
sp->connect_request_len = strlen(sp->connect_request_buf);
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: zoom-c.c,v 1.151 2007-09-21 16:04:48 adam Exp $
+ * $Id: zoom-c.c,v 1.152 2007-11-30 11:44:47 adam Exp $
*/
/**
* \file zoom-c.c
* if it could cause failure when a lookup fails, but that's hard.
*/
static Odr_oid *zoom_yaz_str_to_z3950oid(ZOOM_connection c,
- int oid_class, const char *str) {
+ oid_class oid_class, const char *str) {
Odr_oid *res = yaz_string_to_oid_odr(yaz_oid_std(), oid_class, str,
c->odr_out);
if (res == 0)
odr_prepend(c->odr_out, "ZOOM-C",
ireq->implementationName));
- version = odr_strdup(c->odr_out, "$Revision: 1.151 $");
+ version = odr_strdup(c->odr_out, "$Revision: 1.152 $");
if (strlen(version) > 10) /* check for unexpanded CVS strings */
version[strlen(version)-2] = '\0';
ireq->implementationVersion =
{
Z_IUCorrelationInfo *ci;
ci = notToKeep->elements[0]->correlationInfo =
- odr_malloc(p->odr_out, sizeof(*ci));
+ (Z_IUCorrelationInfo *) odr_malloc(p->odr_out, sizeof(*ci));
ci->note = odr_strdup_null(p->odr_out, correlationInfo_note);
ci->id = correlationInfo_id ?
odr_intdup(p->odr_out, atoi(correlationInfo_id)) : 0;
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: zoom-socket.c,v 1.7 2007-11-10 08:59:31 adam Exp $
+ * $Id: zoom-socket.c,v 1.8 2007-11-30 11:44:47 adam Exp $
*/
/**
* \file zoom-socket.c
ZOOM_API(int)
ZOOM_event_sys_yaz_poll(int no, ZOOM_connection *cs)
{
- struct yaz_poll_fd *yp = xmalloc(sizeof(*yp) * no);
+ struct yaz_poll_fd *yp = (struct yaz_poll_fd *) xmalloc(sizeof(*yp) * no);
int i, r;
int nfds = 0;
int timeout = 30;
continue;
if (mask)
{
- enum yaz_poll_mask input_mask = 0;
+ enum yaz_poll_mask input_mask = yaz_poll_none;
if (mask & ZOOM_SELECT_READ)
- input_mask += yaz_poll_read;
+ yaz_poll_add(input_mask, yaz_poll_read);
if (mask & ZOOM_SELECT_WRITE)
- input_mask += yaz_poll_write;
+ yaz_poll_add(input_mask, yaz_poll_write);
if (mask & ZOOM_SELECT_EXCEPT)
- input_mask += yaz_poll_except;
+ yaz_poll_add(input_mask, yaz_poll_except);
yp[nfds].fd = fd;
yp[nfds].input_mask = input_mask;
yp[nfds].client_data = c;
{
for (i = 0; i < nfds; i++)
{
- ZOOM_connection c = yp[i].client_data;
+ ZOOM_connection c = (ZOOM_connection) yp[i].client_data;
enum yaz_poll_mask output_mask = yp[i].output_mask;
if (output_mask & yaz_poll_timeout)
ZOOM_connection_fire_event_timeout(c);
* Copyright (C) 1995-2006, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: yaz-illclient.c,v 1.8 2007-06-08 10:01:07 heikki Exp $
+ * $Id: yaz-illclient.c,v 1.9 2007-11-30 11:44:47 adam Exp $
*/
/* WARNING - This is work in progress - not at all ready */
int ret;
char *arg;
char *prog=*argv;
- char *version="$Id: yaz-illclient.c,v 1.8 2007-06-08 10:01:07 heikki Exp $"; /* from cvs */
+ const char *version="$Id: yaz-illclient.c,v 1.9 2007-11-30 11:44:47 adam Exp $"; /* from cvs */
struct nameval *nv;
/* default values */
if (args->oclc_auth) {
req->num_iLL_request_extensions=2;
req->iLL_request_extensions=
+ (ILL_Extension **)
odr_malloc(odr, req->num_iLL_request_extensions*
- sizeof(*req->iLL_request_extensions));
+ sizeof(*req->iLL_request_extensions));
req->iLL_request_extensions[0]=makepromptextension(args,odr);
req->iLL_request_extensions[1]=makeoclcextension(args,odr);
}