SCIMBridge 0.4.x

common/scim-bridge-messenger.h

Go to the documentation of this file.
00001 /*
00002  * SCIM Bridge
00003  *
00004  * Copyright (c) 2006 Ryo Dairiki <ryo-dairiki@users.sourceforge.net>
00005  *
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation and 
00010  * appearing in the file LICENSE.LGPL included in the package of this file.
00011  * You can also redistribute it and/or modify it under the terms of 
00012  * the GNU General Public License as published by the Free Software Foundation and 
00013  * appearing in the file LICENSE.GPL included in the package of this file.
00014  *
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00018  */
00019 
00025 #ifndef SCIMBRIDGEMESSAGENGER_H_
00026 #define SCIMBRIDGEMESSAGENGER_H_
00027 
00028 #include "scim-bridge.h"
00029 #include "scim-bridge-message.h"
00030 
00034 typedef struct _ScimBridgeMessenger ScimBridgeMessenger;
00035 
00036 #ifdef __cplusplus
00037 extern "C"
00038 {
00039 #endif
00040 
00047     ScimBridgeMessenger *scim_bridge_alloc_messenger (int socket_fd);
00048 
00055     void scim_bridge_free_messenger (ScimBridgeMessenger *messenger);
00056 
00063     int scim_bridge_messenger_get_socket_fd (const ScimBridgeMessenger *messenger);
00064 
00071     retval_t scim_bridge_close_messenger (ScimBridgeMessenger *messenger);
00072 
00079     boolean scim_bridge_messenger_is_closed (const ScimBridgeMessenger *messenger);
00080 
00088     retval_t scim_bridge_messenger_push_message (ScimBridgeMessenger *messenger, const ScimBridgeMessage *message);
00089 
00097     retval_t scim_bridge_messenger_poll_message (ScimBridgeMessenger *messenger, ScimBridgeMessage **message);
00098 
00106     retval_t scim_bridge_messenger_send_message (ScimBridgeMessenger *messenger, const struct timeval *timeout);
00107 
00115     retval_t scim_bridge_messenger_receive_message (ScimBridgeMessenger *messenger, const struct timeval *timeout);
00116 
00124     ssize_t scim_bridge_messenger_get_sending_buffer_size (const ScimBridgeMessenger *messenger);
00125 
00133     ssize_t scim_bridge_messenger_get_receiving_buffer_size (const ScimBridgeMessenger *messenger);
00134 
00135 #ifdef __cplusplus
00136 }
00137 #endif
00138 #endif                                            /*SCIMBRIDGEMESSAGENGER_H_*/