X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fzoom-socket.c;h=cb5579af431e68eff85e500e222fcfe79b1e030a;hp=92998843d80e138b88920e1294f06d22144afa8c;hb=0e7fdbc857d4905e67a7bdf8fe5b6c773ee47a7b;hpb=91c35d653aea231aff9efc3eef6a6ab6662dd129 diff --git a/src/zoom-socket.c b/src/zoom-socket.c index 9299884..cb5579a 100644 --- a/src/zoom-socket.c +++ b/src/zoom-socket.c @@ -1,13 +1,14 @@ -/* - * Copyright (C) 1995-2007, Index Data ApS +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2012 Index Data * See the file LICENSE for details. - * - * $Id: zoom-socket.c,v 1.7 2007-11-10 08:59:31 adam Exp $ */ /** * \file zoom-socket.c * \brief Implements ZOOM C socket interface. */ +#if HAVE_CONFIG_H +#include +#endif #include #include @@ -29,7 +30,7 @@ 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; @@ -49,14 +50,14 @@ ZOOM_API(int) 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; @@ -73,7 +74,7 @@ ZOOM_API(int) { 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); @@ -110,6 +111,7 @@ ZOOM_API(int) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab