示例#1
0
void GameManager::clickedPlay()
{
    lobby = new Lobby;


    connect(lobby, SIGNAL(c_exit()), this, SLOT(showMainMenu()));
    connect(lobby, SIGNAL(c_go()), this, SLOT(startGame()));

    connect(lobby, SIGNAL(c_exit()), this, SLOT(removeLobby()));
    connect(lobby, SIGNAL(c_go()), this, SLOT(removeLobby()));
}
static int c_direct_set_priv(const struct buxton_layer *layer,
		const char *key, const char *priv, enum buxton_priv_type type)
{
	int r;

	if (!layer || !key || !*key || !priv) {
		errno = EINVAL;
		bxt_err("Set-priv: Layer '%s' Key '%s' Priv. '%s': %s",
				layer ? buxton_layer_get_name(layer) : "",
				key ? key : "", priv ? priv : "",
				strerror(errno));
		return -1;
	}

	r = c_init();
	if (r == -1)
		return -1;

	r = direct_set_priv(layer, key, type, priv);

	c_exit();

	if (r == -1) {
		bxt_err("Set-priv: Layer '%s' Key '%s' Priv. '%s': %s",
				buxton_layer_get_name(layer), key, priv,
				strerror(errno));
	}

	return r;
}
int c_direct_unset(const struct buxton_layer *layer,
		const char *key, UNUSED const char *value,
		UNUSED const char *rpriv, UNUSED const char *wpriv)
{
	int r;

	if (!layer || !key || !*key) {
		errno = EINVAL;
		bxt_err("Unset: Layer '%s' Key '%s': %s",
				layer ? buxton_layer_get_name(layer) : "",
				key ? key : "", strerror(errno));
		return -1;
	}

	r = c_init();
	if (r == -1)
		return -1;

	r = direct_unset(layer, key);

	c_exit();

	if (r == -1) {
		bxt_err("Unset: Layer '%s' Key '%s': %s",
				buxton_layer_get_name(layer), key,
				strerror(errno));
	}

	return r;
}
static int c_direct_set(const struct buxton_layer *layer,
		const char *key, const char *value, enum buxton_key_type type)
{
	int r;
	struct buxton_value val;

	if (!layer || !key || !*key || !value) {
		errno = EINVAL;
		bxt_err("Set: Layer '%s' Key '%s' Value '%s': %s",
				layer ? buxton_layer_get_name(layer) : "",
				key ? key : "", value ? value : "",
				strerror(errno));
		return -1;
	}

	r = c_set_value(type, value, &val);
	if (r == -1)
		return -1;

	r = c_init();
	if (r == -1)
		return -1;

	r = direct_set(layer, key, &val);

	c_exit();

	if (r == -1) {
		bxt_err("Set: Layer '%s' Key '%s' Value '%s': %s",
				buxton_layer_get_name(layer), key, value,
				strerror(errno));
	}

	return r;
}
示例#5
0
void fxCheck(txMachine* the, txString thePath, txInteger theLine)
{
#if mxWindows
	fprintf(stderr, "%s(%ld): fatal!\n", thePath, theLine);
	DebugBreak();
#else
	fxDebugLoop(the, "%s:%ld: fatal!\n", thePath, theLine);
#endif
	c_exit(0);
}
示例#6
0
//call the appropriate method based on the swi
int c_swi_handler(unsigned swi_num, unsigned * regs){
	
	int ret = 0;

	//if(debug_enabled ==1) printf ("c_swi_handler:: swi_num = %d\n", swi_num ) ;
	switch(swi_num){

		case EXIT_SWI:
			c_exit(regs[0]);
			break;

		case READ_SWI:
			ret = read_syscall(regs[0], (void *) regs[1], regs[2]);
			break;

		case WRITE_SWI:
			ret = write_syscall(regs[0], (void *) regs[1], regs[2]);
			break;

		case TIME_SWI:
			ret = time_syscall();
			break;

		case SLEEP_SWI:
			sleep_syscall(regs[0]);
			break;

		case CREATE_SWI:
			ret = task_create((task_t*)regs[0], regs[1]);
			break;

		case MUTEX_CREATE:
			ret = mutex_create();
			break;

		case MUTEX_LOCK:
			ret = mutex_lock(regs[0]);
			break;

		case MUTEX_UNLOCK:
			ret = mutex_unlock(regs[0]);
			break;

		case EVENT_WAIT:
			ret = event_wait(regs[0]);
			break;

		default:
			invalid_syscall(0x0badc0de);
			break;
	}

	
	return ret;
}
int
gsdll_class::unload(void)
{
    // exit Ghostscript interpreter
    if (initialized) {
        if (!execute_code)
            c_execute_end();
        c_exit();
#ifndef __WIN32__
        FreeProcInstance((FARPROC)callback);
#endif
        callback = NULL;
    }

    // For Win16, must free the thunks.
#ifndef __WIN32__
// is it safe to call these with NULL pointers?
    FreeProcInstance(c_revision);
    FreeProcInstance(c_init);
    FreeProcInstance(c_execute_begin);
    FreeProcInstance(c_execute_cont);
    FreeProcInstance(c_execute_end);
    FreeProcInstance(c_exit);
    FreeProcInstance(c_lock_device);
    FreeProcInstance(c_copy_dib);
    FreeProcInstance(c_copy_palette);
    FreeProcInstance(c_draw);
#endif

    // Set functions to NULL to prevent use
    c_revision = NULL;
    c_init = NULL;
    c_execute_begin = NULL;
    c_execute_cont = NULL;
    c_execute_end = NULL;
    c_exit = NULL;
    c_lock_device = NULL;
    c_copy_dib = NULL;
    c_copy_palette = NULL;
    c_draw = NULL;

    // need to do more than this
    device = NULL;

    // Don't do anything else if already unloaded
    if (hmodule == (HINSTANCE)NULL)
        return 0;

    return 0;
}
int c_direct_list(const struct buxton_layer *layer,
		UNUSED const char *key, UNUSED const char *value,
		UNUSED const char *rpriv, UNUSED const char *wpriv)
{
	int r;
	char **keys;
	char **k;

	if (!layer) {
		errno = EINVAL;
		bxt_err("List: Layer '%s': %s",
				layer ? buxton_layer_get_name(layer) : "",
				strerror(errno));
		return -1;
	}

	r = c_init();
	if (r == -1)
		return -1;

	r = direct_list(layer, &keys, NULL);

	c_exit();

	if (r == -1) {
		bxt_err("List: Layer '%s': %s", buxton_layer_get_name(layer),
				strerror(errno));
		return -1;
	}

	k = keys;
	while (k && *k) {
		printf("%s\n", *k);
		k++;
	}

	buxton_free_keys(keys);

	return 0;
}
static int c_direct_create(const struct buxton_layer *layer,
		const char *key, const char *value, enum buxton_key_type type,
		const char *rpriv, const char *wpriv)
{
	int r;
	struct buxton_value val;

	if (!layer || !key || !*key || !value || !rpriv || !wpriv) {
		errno = EINVAL;
		bxt_err("Create: '%s' '%s' '%s' Priv '%s' '%s': %s",
				layer ? buxton_layer_get_name(layer) : "",
				key ? key : "", value ? value : "",
				rpriv ? rpriv : "", wpriv ? wpriv : "",
				strerror(errno));
		return -1;
	}

	r = c_set_value(type, value, &val);
	if (r == -1)
		return -1;

	r = c_init();
	if (r == -1)
		return -1;

	r = direct_create(layer, key, rpriv, wpriv, &val);

	c_exit();

	if (r == -1) {
		bxt_err("Create: '%s' '%s' '%s' Priv '%s' '%s': %s",
				buxton_layer_get_name(layer), key, value,
				rpriv, wpriv, strerror(errno));
	}

	return r;
}
示例#10
0
static int os_exit (lua_State *L) {
  c_exit(luaL_optint(L, 1, EXIT_SUCCESS));
}
示例#11
0
void fxAbort(txMachine* the)
{
	fxWriteBreakpoints(the);
	fxDisconnect(the);
	c_exit(0);
}