rcc: Make some functions/macros private

Some constants/macros/function prototypes are defined in
red-channel-client.h while they are only used by red-channel-client.c.
This commit moves them to the .c file to make them private.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
Frediano Ziglio 2017-02-14 21:05:57 +00:00
parent 10654d34a4
commit 4838f317a9
2 changed files with 24 additions and 24 deletions

View File

@ -37,6 +37,14 @@
#include "red-client.h"
#include "glib-compat.h"
#define CLIENT_ACK_WINDOW 20
#define MAX_HEADER_SIZE sizeof(SpiceDataHeader)
#ifndef IOV_MAX
#define IOV_MAX 1024
#endif
typedef struct SpiceDataHeaderOpaque SpiceDataHeaderOpaque;
typedef uint16_t (*get_msg_type_proc)(SpiceDataHeaderOpaque *header);
@ -147,6 +155,21 @@ static const SpiceDataHeaderOpaque mini_header_wrapper;
static void red_channel_client_clear_sent_item(RedChannelClient *rcc);
static void red_channel_client_destroy_remote_caps(RedChannelClient* rcc);
static void red_channel_client_initable_interface_init(GInitableIface *iface);
static void red_channel_client_set_message_serial(RedChannelClient *channel, uint64_t);
/*
* When an error occurs over a channel, we treat it as a warning
* for spice-server and shutdown the channel.
*/
#define spice_channel_client_error(rcc, format, ...) \
do { \
RedChannel *_ch = red_channel_client_get_channel(rcc); \
uint32_t _type, _id; \
g_object_get(_ch, "channel-type", &_type, "id", &_id, NULL); \
spice_warning("rcc %p type %u id %u: " format, rcc, \
type, id, ## __VA_ARGS__); \
red_channel_client_shutdown(rcc); \
} while (0)
G_DEFINE_TYPE_WITH_CODE(RedChannelClient, red_channel_client, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE(G_TYPE_INITABLE,
@ -1568,7 +1591,7 @@ uint64_t red_channel_client_get_message_serial(RedChannelClient *rcc)
return rcc->priv->send_data.last_sent_serial + 1;
}
void red_channel_client_set_message_serial(RedChannelClient *rcc, uint64_t serial)
static void red_channel_client_set_message_serial(RedChannelClient *rcc, uint64_t serial)
{
rcc->priv->send_data.last_sent_serial = serial - 1;
}

View File

@ -20,7 +20,6 @@
#include <glib-object.h>
#include <gio/gio.h>
#include <spice/protocol.h>
#include <common/marshaller.h>
#include "red-pipe-item.h"
@ -29,13 +28,6 @@
G_BEGIN_DECLS
#define MAX_HEADER_SIZE sizeof(SpiceDataHeader)
#define CLIENT_ACK_WINDOW 20
#ifndef IOV_MAX
#define IOV_MAX 1024
#endif
#define RED_TYPE_CHANNEL_CLIENT red_channel_client_get_type()
#define RED_CHANNEL_CLIENT(obj) \
@ -55,20 +47,6 @@ typedef struct RedChannelClientPrivate RedChannelClientPrivate;
GType red_channel_client_get_type(void) G_GNUC_CONST;
/*
* When an error occurs over a channel, we treat it as a warning
* for spice-server and shutdown the channel.
*/
#define spice_channel_client_error(rcc, format, ...) \
do { \
RedChannel *_ch = red_channel_client_get_channel(rcc); \
uint32_t _type, _id; \
g_object_get(_ch, "channel-type", &_type, "id", &_id, NULL); \
spice_warning("rcc %p type %u id %u: " format, rcc, \
type, id, ## __VA_ARGS__); \
red_channel_client_shutdown(rcc); \
} while (0)
RedChannelClient *red_channel_client_create(RedChannel *channel,
RedClient *client, RedsStream *stream,
int monitor_latency,
@ -92,7 +70,6 @@ int red_channel_client_handle_message(RedChannelClient *rcc, uint16_t type,
void red_channel_client_init_send_data(RedChannelClient *rcc, uint16_t msg_type);
uint64_t red_channel_client_get_message_serial(RedChannelClient *channel);
void red_channel_client_set_message_serial(RedChannelClient *channel, uint64_t);
/* When sending a msg. Should first call red_channel_client_begin_send_message.
* It will first send the pending urgent data, if there is any, and then