Commit Graph

5 Commits

Author SHA1 Message Date
Frediano Ziglio
cb9bd1b09e Make headers independent
Make sure all headers can be compiled alone.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2021-05-18 10:13:41 +01:00
Frediano Ziglio
e0b395fb68 Declare exported functions as C
Allows to be used by both C and C++ code.
So to leave part of the code in C and part move to C++.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-05-01 06:58:08 +01:00
Christophe Fergeau
bc5326b1ce Unify header guards
This changes the header guards in all .h files to follow this format:

/*
 * Licensing block
 */

/* ... */

Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-03-30 18:17:20 +01:00
Frediano Ziglio
f36c3887ba 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>
2016-05-18 00:24:37 +01:00
Frediano Ziglio
525cd67be7 server: rename files
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-12-03 23:54:32 +00:00