static void vnc_set_share_mode(VncState *vs, VncShareMode mode)

{

#ifdef _VNC_DEBUG

    static const char *mn[] = {

        [0]                           = "undefined",

        [VNC_SHARE_MODE_CONNECTING]   = "connecting",

        [VNC_SHARE_MODE_SHARED]       = "shared",

        [VNC_SHARE_MODE_EXCLUSIVE]    = "exclusive",

        [VNC_SHARE_MODE_DISCONNECTED] = "disconnected",

    };

    fprintf(stderr, "%s/%d: %s -> %s\n", __func__,

            vs->csock, mn[vs->share_mode], mn[mode]);

#endif



    if (vs->share_mode == VNC_SHARE_MODE_EXCLUSIVE) {

        vs->vd->num_exclusive--;

    }

    vs->share_mode = mode;

    if (vs->share_mode == VNC_SHARE_MODE_EXCLUSIVE) {

        vs->vd->num_exclusive++;

    }

}

static void vnc_set_share_mode(VncState *vs, VncShareMode mode)

{

#ifdef _VNC_DEBUG

    static const char *mn[] = {

        [0]                           = "undefined",

        [VNC_SHARE_MODE_CONNECTING]   = "connecting",

        [VNC_SHARE_MODE_SHARED]       = "shared",

        [VNC_SHARE_MODE_EXCLUSIVE]    = "exclusive",

        [VNC_SHARE_MODE_DISCONNECTED] = "disconnected",

    };

    fprintf(stderr, "%s/%d: %s -> %s\n", __func__,

            vs->csock, mn[vs->share_mode], mn[mode]);

#endif



    if (vs->share_mode == VNC_SHARE_MODE_EXCLUSIVE) {

        vs->vd->num_exclusive--;

    }

    vs->share_mode = mode;

    if (vs->share_mode == VNC_SHARE_MODE_EXCLUSIVE) {

        vs->vd->num_exclusive++;

    }

}

    if (vs->share_mode == VNC_SHARE_MODE_EXCLUSIVE) {     if (vs->share_mode == VNC_SHARE_MODE_EXCLUSIVE) {
static void FUNC_0(VncState *VAR_0, VncShareMode VAR_1)

{

#ifdef _VNC_DEBUG

    static const char *mn[] = {

        [0]                           = "undefined",

        [VNC_SHARE_MODE_CONNECTING]   = "connecting",

        [VNC_SHARE_MODE_SHARED]       = "shared",

        [VNC_SHARE_MODE_EXCLUSIVE]    = "exclusive",

        [VNC_SHARE_MODE_DISCONNECTED] = "disconnected",

    };

    fprintf(stderr, "%s/%d: %s -> %s\n", __func__,

            VAR_0->csock, mn[VAR_0->share_mode], mn[VAR_1]);

#endif



    if (VAR_0->share_mode == VNC_SHARE_MODE_EXCLUSIVE) {

        VAR_0->vd->num_exclusive--;

    }

    VAR_0->share_mode = VAR_1;

    if (VAR_0->share_mode == VNC_SHARE_MODE_EXCLUSIVE) {

        VAR_0->vd->num_exclusive++;

    }

}

static void FUNC_0(VncState *VAR_0, VncShareMode VAR_1)
{ #ifdef _VNC_DEBUG
static const char *mn[] = { [0]                           = "undefined",
[VNC_SHARE_MODE_CONNECTING]   = "connecting",
[VNC_SHARE_MODE_SHARED]       = "shared",
[VNC_SHARE_MODE_EXCLUSIVE]    = "exclusive",
[VNC_SHARE_MODE_DISCONNECTED] = "disconnected",
}; fprintf(stderr, "%s/%d: %s -> %s\n", __func__,
VAR_0->csock, mn[VAR_0->share_mode], mn[VAR_1]); #endif
if (VAR_0->share_mode == VNC_SHARE_MODE_EXCLUSIVE) { VAR_0->vd->num_exclusive--; } VAR_0->share_mode = VAR_1; if (VAR_0->share_mode == VNC_SHARE_MODE_EXCLUSIVE) { VAR_0->vd->num_exclusive++; } }