Make sure all headers are independent

Make sure is possible to include any headers alone.

I used this script to check independence (run under server directory):
----
#!/bin/bash

set -e

# check not already modified
if grep -q libheaders.la Makefile.am; then
    echo "Header library already prepared" >&2
    exit 1
fi

add_lib() {
    local hdr="$1"

    hdr=${hdr%.h}
    c="mao_${hdr}.c"
    echo "#include \"${hdr}.h\"" > $c
    echo -e "\t$c \\" >&3
}

# add library to compile all headers alones
exec 3>> Makefile.am
echo "
noinst_LTLIBRARIES += libheaders.la
libheaders_la_SOURCES =				\\" >&3
for hdr in *.h; do
    case $hdr in
    spice-bitmap-utils.h)
        add_lib $hdr
        ;;
    spice*.h)
        ;;
    *)
        add_lib $hdr
        ;;
    esac
done
echo -e "\t\$(NULL)" >&3
exec 3>&-
----

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
Frediano Ziglio 2016-05-18 00:01:57 +01:00
parent 9fd82215d1
commit f36c3887ba
11 changed files with 31 additions and 3 deletions

View File

@ -21,6 +21,9 @@
#ifndef _H_AGENT_MSG_FILTER
#define _H_AGENT_MSG_FILTER
#include <inttypes.h>
#include <glib.h>
/* Possible return values for agent_msg_filter_process_data */
enum {
AGENT_MSG_FILTER_OK,

View File

@ -17,6 +17,9 @@
#ifndef _H_DEMARSHAL
#define _H_DEMARSHAL
#include <stddef.h>
#include <inttypes.h>
typedef void (*message_destructor_t)(uint8_t *message);
typedef uint8_t * (*spice_parse_channel_func_t)(uint8_t *message_start, uint8_t *message_end, uint16_t message_type, int minor,
size_t *size_out, message_destructor_t *free_message);

View File

@ -18,7 +18,10 @@
#ifndef GLZ_ENCODER_PRIV_H_
#define GLZ_ENCODER_PRIV_H_
#include "red-common.h"
#include <pthread.h>
#include <common/lz_common.h>
#include "glz-encoder-dict.h"
/* Interface for using the dictionary for encoding.
Data structures are exposed for the encoder for efficiency

View File

@ -24,6 +24,8 @@
#include <stdint.h>
#include <spice/vd_agent.h>
#include "red-channel.h"
typedef struct InputsChannel InputsChannel;
InputsChannel* inputs_channel_new(RedsState *reds);

View File

@ -20,6 +20,7 @@
#include <spice/macros.h>
#include <spice/vd_agent.h>
#include <common/log.h>
#include "glz-encoder-dict.h"

View File

@ -19,6 +19,11 @@
#define REDS_PRIVATE_H
#include <spice/protocol.h>
#include <spice/stats.h>
#include "main-dispatcher.h"
#include "main-channel.h"
#include "inputs-channel.h"
#define MIGRATE_TIMEOUT (MSEC_PER_SEC * 10)
#define MM_TIME_DELTA 400 /*ms*/

View File

@ -20,6 +20,8 @@
#include <glib-object.h>
#include "char-device.h"
#define RED_TYPE_CHAR_DEVICE_SMARTCARD red_char_device_smartcard_get_type()
#define RED_CHAR_DEVICE_SMARTCARD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), RED_TYPE_CHAR_DEVICE_SMARTCARD, RedCharDeviceSmartcard))

View File

@ -18,7 +18,9 @@
#ifndef SOUND_H_
#define SOUND_H_
#include "spice.h"
#include "red-common.h"
struct RedClient;
void snd_attach_playback(RedsState *reds, SpicePlaybackInstance *sin);
void snd_detach_playback(SpicePlaybackInstance *sin);
@ -28,6 +30,6 @@ void snd_detach_record(SpiceRecordInstance *sin);
void snd_set_playback_compression(int on);
void snd_set_playback_latency(RedClient *client, uint32_t latency);
void snd_set_playback_latency(struct RedClient *client, uint32_t latency);
#endif

View File

@ -21,6 +21,8 @@
#include <stdint.h>
#include <glib.h>
#include "spice.h"
typedef uint32_t StatNodeRef;
#define INVALID_STAT_REF (~(StatNodeRef)0)

View File

@ -21,6 +21,9 @@
#ifndef _H_VIDEO_ENCODER
#define _H_VIDEO_ENCODER
#include <inttypes.h>
#include <common/draw.h>
enum {
VIDEO_ENCODER_FRAME_UNSUPPORTED = -1,
VIDEO_ENCODER_FRAME_DROP,

View File

@ -30,6 +30,8 @@
#ifndef _H_ZLIB_ENCODER
#define _H_ZLIB_ENCODER
#include <inttypes.h>
typedef struct ZlibEncoder ZlibEncoder;
typedef struct ZlibEncoderUsrContext ZlibEncoderUsrContext;