diff options
-rw-r--r-- | canvas_base.h | 8 | ||||
-rw-r--r-- | canvas_utils.h | 8 | ||||
-rw-r--r-- | draw.h | 8 | ||||
-rw-r--r-- | gdi_canvas.h | 8 | ||||
-rw-r--r-- | gl_canvas.h | 7 | ||||
-rw-r--r-- | gl_utils.h | 8 | ||||
-rw-r--r-- | glc.h | 8 | ||||
-rw-r--r-- | lines.h | 8 | ||||
-rw-r--r-- | lz.h | 7 | ||||
-rw-r--r-- | lz_common.h | 7 | ||||
-rw-r--r-- | marshaller.h | 8 | ||||
-rw-r--r-- | mem.h | 7 | ||||
-rw-r--r-- | messages.h | 10 | ||||
-rw-r--r-- | mutex.h | 9 | ||||
-rw-r--r-- | ogl_ctx.h | 8 | ||||
-rw-r--r-- | pixman_utils.h | 8 | ||||
-rw-r--r-- | quic.h | 8 | ||||
-rw-r--r-- | quic_config.h | 8 | ||||
-rw-r--r-- | rect.h | 8 | ||||
-rw-r--r-- | region.h | 8 | ||||
-rw-r--r-- | ring.h | 8 | ||||
-rw-r--r-- | rop3.h | 9 | ||||
-rw-r--r-- | sw_canvas.h | 8 |
23 files changed, 182 insertions, 2 deletions
diff --git a/canvas_base.h b/canvas_base.h index 2166dcf..ff0f972 100644 --- a/canvas_base.h +++ b/canvas_base.h @@ -25,6 +25,10 @@ #include "region.h" #include "draw.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef void (*spice_destroy_fn_t)(void *data); typedef struct _SpiceImageCache SpiceImageCache; @@ -310,4 +314,8 @@ struct _SpiceCanvas { SpiceCanvasOps *ops; }; +#ifdef __cplusplus +} +#endif + #endif diff --git a/canvas_utils.h b/canvas_utils.h index b87b816..ffed927 100644 --- a/canvas_utils.h +++ b/canvas_utils.h @@ -24,6 +24,10 @@ #include "pixman_utils.h" #include "lz.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct PixmanData { #ifdef WIN32 HBITMAP bitmap; @@ -65,4 +69,8 @@ typedef struct LzDecodeUsrData { pixman_image_t *alloc_lz_image_surface(LzDecodeUsrData *canvas_data, pixman_format_code_t pixman_format, int width, int height, int gross_pixels, int top_down); +#ifdef __cplusplus +} +#endif + #endif @@ -35,6 +35,10 @@ #include <spice/enums.h> #include "mem.h" +#ifdef __cplusplus +extern "C" { +#endif + #define SPICE_GET_ADDRESS(addr) ((void *)(unsigned long)(addr)) #define SPICE_SET_ADDRESS(addr, val) ((addr) = (unsigned long)(val)) @@ -270,4 +274,8 @@ typedef struct SpiceCursorHeader { uint16_t hot_spot_y; } SpiceCursorHeader; +#ifdef __cplusplus +} +#endif + #endif /* _H_SPICE_DRAW */ diff --git a/gdi_canvas.h b/gdi_canvas.h index b3d4b15..5cdffb3 100644 --- a/gdi_canvas.h +++ b/gdi_canvas.h @@ -21,6 +21,10 @@ #include <stdint.h> +#ifdef __cplusplus +extern "C" { +#endif + #include "pixman_utils.h" #include "canvas_base.h" #include "region.h" @@ -36,4 +40,8 @@ SpiceCanvas *gdi_canvas_create(int width, int height, void gdi_canvas_init(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gl_canvas.h b/gl_canvas.h index d7125e6..ff3fba0 100644 --- a/gl_canvas.h +++ b/gl_canvas.h @@ -20,6 +20,10 @@ #include "canvas_base.h" #include "region.h" +#ifdef __cplusplus +extern "C" { +#endif + SpiceCanvas *gl_canvas_create(int width, int height, uint32_t format #ifdef SW_CANVAS_CACHE , SpiceImageCache *bits_cache @@ -35,3 +39,6 @@ SpiceCanvas *gl_canvas_create(int width, int height, uint32_t format void gl_canvas_set_textures_lost(SpiceCanvas *canvas, int textures_lost); void gl_canvas_init(); +#ifdef __cplusplus +} +#endif @@ -21,6 +21,10 @@ #ifndef GL_UTILS_H #define GL_UTILS_H +#ifdef __cplusplus +extern "C" { +#endif + #ifdef RED_DEBUG #define GLC_ERROR_TEST_FLUSH { \ GLenum gl_err; glFlush(); \ @@ -102,4 +106,8 @@ static inline int gl_get_to_power_two(unsigned int val) return 1 << find_msb(val); } +#ifdef __cplusplus +} +#endif + #endif @@ -23,6 +23,10 @@ #include <stdint.h> +#ifdef __cplusplus +extern "C" { +#endif + typedef void * GLCCtx; typedef void * GLCPattern; typedef void * GLCPath; @@ -156,4 +160,8 @@ void glc_clear(GLCCtx glc); GLCCtx glc_create(int width, int height); void glc_destroy(GLCCtx glc, int textures_lost); +#ifdef __cplusplus +} +#endif + #endif @@ -54,6 +54,10 @@ SOFTWARE. #include <string.h> #include "draw.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct lineGC lineGC; typedef struct { @@ -127,4 +131,8 @@ extern int spice_canvas_clip_spans(pixman_region32_t *clip_region, int *new_widths, int sorted); +#ifdef __cplusplus +} +#endif + #endif /* LINES_H */ @@ -10,6 +10,10 @@ #include "lz_config.h" #include "draw.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef void *LzContext; typedef struct LzUsrContext LzUsrContext; @@ -71,5 +75,8 @@ LzContext *lz_create(LzUsrContext *usr); void lz_destroy(LzContext *lz); +#ifdef __cplusplus +} +#endif #endif // __LZ_H diff --git a/lz_common.h b/lz_common.h index 34276af..4156cff 100644 --- a/lz_common.h +++ b/lz_common.h @@ -23,6 +23,10 @@ #ifndef _LZ_COMMON_H #define _LZ_COMMON_H +#ifdef __cplusplus +extern "C" { +#endif + //#define DEBUG /* change the max window size will require change in the encoding format*/ @@ -58,5 +62,8 @@ static const int RGB_BYTES_PER_PIXEL[] = {0, 1, 1, 1, 1, 1, 2, 3, 4, 4, 4}; #define LZ_VERSION_MINOR 1U #define LZ_VERSION ((LZ_VERSION_MAJOR << 16) | (LZ_VERSION_MINOR & 0xffff)) +#ifdef __cplusplus +} +#endif #endif // _LZ_COMMON_H diff --git a/marshaller.h b/marshaller.h index 4d77140..0a61fef 100644 --- a/marshaller.h +++ b/marshaller.h @@ -25,6 +25,10 @@ #include <sys/uio.h> #endif +#ifdef __cplusplus +extern "C" { +#endif + typedef struct SpiceMarshaller SpiceMarshaller; typedef void (*spice_marshaller_item_free_func)(uint8_t *data, void *opaque); @@ -63,4 +67,8 @@ void *spice_marshaller_add_int8(SpiceMarshaller *m, int8_t v); void spice_marshaller_set_uint32(SpiceMarshaller *m, void *ref, uint32_t v); +#ifdef __cplusplus +} +#endif + #endif @@ -22,6 +22,10 @@ #include <stdlib.h> #include <spice/macros.h> +#ifdef __cplusplus +extern "C" { +#endif + typedef struct SpiceChunk { uint8_t *data; uint32_t len; @@ -120,4 +124,7 @@ void spice_buffer_append(SpiceBuffer *buffer, const void *data, size_t len); size_t spice_buffer_copy(SpiceBuffer *buffer, void *dest, size_t len); size_t spice_buffer_remove(SpiceBuffer *buffer, size_t len); +#ifdef __cplusplus +} +#endif #endif @@ -34,6 +34,10 @@ #include <spice/protocol.h> #include "draw.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct SpiceMsgData { uint32_t data_size; uint8_t data[0]; @@ -494,6 +498,8 @@ typedef struct SpiceMsgcTunnelSocketTokens { uint32_t num_tokens; } SpiceMsgcTunnelSocketTokens; -#endif /* _H_SPICE_PROTOCOL */ - +#ifdef __cplusplus +} +#endif +#endif /* _H_SPICE_PROTOCOL */ @@ -18,6 +18,11 @@ #ifndef _H_MUTEX #define _H_MUTEX + +#ifdef __cplusplus +extern "C" { +#endif + #ifdef _WIN32 #include <windows.h> typedef CRITICAL_SECTION mutex_t; @@ -32,4 +37,8 @@ typedef pthread_mutex_t mutex_t; #define MUTEX_UNLOCK(mutex) pthread_mutex_unlock(&mutex) #endif +#ifdef __cplusplus +} +#endif + #endif // _H_MUTEX @@ -19,6 +19,10 @@ #ifndef _H_GLCTX #define _H_GLCTX +#ifdef __cplusplus +extern "C" { +#endif + typedef struct OGLCtx OGLCtx; const char *oglctx_type_str(OGLCtx *ctx); @@ -27,5 +31,9 @@ OGLCtx *pbuf_create(int width, int heigth); OGLCtx *pixmap_create(int width, int heigth); void oglctx_destroy(OGLCtx *ctx); +#ifdef __cplusplus +} +#endif + #endif diff --git a/pixman_utils.h b/pixman_utils.h index e15b682..61eaddd 100644 --- a/pixman_utils.h +++ b/pixman_utils.h @@ -26,6 +26,10 @@ #include "draw.h" +#ifdef __cplusplus +extern "C" { +#endif + /* This lists all possible 2 argument binary raster ops. * This enum has the same values as the X11 GXcopy type * and same as the GL constants (GL_AND etc) if you @@ -125,4 +129,8 @@ void spice_pixman_copy_rect(pixman_image_t *image, int w, int h, int dest_x, int dest_y); +#ifdef __cplusplus +} +#endif + #endif /* _H__PIXMAN_UTILS */ @@ -21,6 +21,10 @@ #include "quic_config.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { QUIC_IMAGE_TYPE_INVALID, QUIC_IMAGE_TYPE_GRAY, @@ -61,5 +65,9 @@ void quic_destroy(QuicContext *quic); void quic_init(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/quic_config.h b/quic_config.h index 1273dbc..da5e51c 100644 --- a/quic_config.h +++ b/quic_config.h @@ -21,6 +21,10 @@ #include <spice/types.h> +#ifdef __cplusplus +extern "C" { +#endif + #ifdef __GNUC__ #include <string.h> @@ -47,5 +51,9 @@ #endif +#ifdef __cplusplus +} +#endif + #endif @@ -22,6 +22,10 @@ #include "draw.h" #include <spice/macros.h> +#ifdef __cplusplus +extern "C" { +#endif + static inline void rect_sect(SpiceRect* r, const SpiceRect* bounds) { r->left = MAX(r->left, bounds->left); @@ -73,6 +77,10 @@ static inline int rect_is_same_size(const SpiceRect *r1, const SpiceRect *r2) } #ifdef __cplusplus +} +#endif + +#ifdef __cplusplus static inline void rect_sect(SpiceRect& r, const SpiceRect& bounds) { @@ -23,6 +23,10 @@ #include "draw.h" #include <pixman_utils.h> +#ifdef __cplusplus +extern "C" { +#endif + typedef pixman_region32_t QRegion; #define REGION_TEST_LEFT_EXCLUSIVE (1 << 0) @@ -59,5 +63,9 @@ void region_offset(QRegion *rgn, int32_t dx, int32_t dy); void region_dump(const QRegion *rgn, const char *prefix); +#ifdef __cplusplus +} +#endif + #endif @@ -21,6 +21,10 @@ #include "spice_common.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct Ring RingItem; typedef struct Ring { RingItem *prev; @@ -150,5 +154,9 @@ static inline RingItem *ring_prev(Ring *ring, RingItem *pos) (var) = ring_prev(ring, var)) +#ifdef __cplusplus +} +#endif + #endif @@ -24,11 +24,20 @@ #include "draw.h" #include "pixman_utils.h" +#ifdef __cplusplus +extern "C" { +#endif + void do_rop3_with_pattern(uint8_t rop3, pixman_image_t *d, pixman_image_t *s, SpicePoint *src_pos, pixman_image_t *p, SpicePoint *pat_pos); void do_rop3_with_color(uint8_t rop3, pixman_image_t *d, pixman_image_t *s, SpicePoint *src_pos, uint32_t rgb); void rop3_init(); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/sw_canvas.h b/sw_canvas.h index 99deac8..42f2573 100644 --- a/sw_canvas.h +++ b/sw_canvas.h @@ -26,6 +26,10 @@ #include "canvas_base.h" #include "region.h" +#ifdef __cplusplus +extern "C" { +#endif + SpiceCanvas *canvas_create(int width, int height, uint32_t format #ifdef SW_CANVAS_CACHE , SpiceImageCache *bits_cache @@ -55,4 +59,8 @@ SpiceCanvas *canvas_create_for_data(int width, int height, uint32_t format, uint void sw_canvas_init(); +#ifdef __cplusplus +} +#endif + #endif |