2
* geis-server.c Test driver for the GEIS server.
4
* Copyright 2011 Canonical Ltd.
6
* This library is free software; you can redistribute it and/or modify it under
7
* the terms of the GNU General Public License as published by the Free Software
8
* Foundation; either version 3 of the License, or (at your option) any later
11
* This library is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/.
20
#include <geis/geis.h>
23
#include <sys/select.h>
31
Geis geis = geis_new(GEIS_INIT_SERVICE_PROVIDER,
32
GEIS_INIT_XCB_BACKEND,
36
fprintf(stderr, "error creating geis instance.\n");
41
status = geis_get_configuration(geis, GEIS_CONFIGURATION_FD, &geis_fd);
42
if (status != GEIS_STATUS_SUCCESS)
44
fprintf(stderr, "error obtaining geis fd.\n");
53
FD_SET(geis_fd, &read_fds);
55
int sstat = select(geis_fd + 1, &read_fds, NULL, NULL, NULL);
58
fprintf(stderr, "error %d in select(): %s\n", errno, strerror(errno));
62
if (FD_ISSET(geis_fd, &read_fds))
64
status = geis_dispatch_events(geis);
67
status = geis_next_event(geis, &event_out);
68
while (status == GEIS_STATUS_CONTINUE || status == GEIS_STATUS_SUCCESS)
70
geis_event_delete(event_out);
71
status = geis_next_event(geis, &event_out);
75
if (FD_ISSET(0, &read_fds))