Пример #1
0
void cleanup()
{
	remove_hook();
	if (!isattached)
		killtask();

	free_symbols();
	close_all_elfhandles();
	stabs_free_stabs();

	hex_close_window();
	breakpoints_close_window();
	modules_close_window();
	main_close_window();
	arexx_close_port();
	
	IExec->FreeSysObject(ASOT_PORT, AppPort);
	
	pipe_cleanup();
	
	variables_cleanup();
	console_cleanup();
	stacktrace_cleanup();
	source_cleanup();
	disassembler_cleanup();
	sourcelist_cleanup();
	
	freemem_free_hook(main_freemem_hook);

	char sysstring[1024] = "";	
	sprintf(sysstring, "setenv DB101_LASTDIR SAVE \"%s\"", lastdir);
	IDOS->SystemTags(sysstring, TAG_END);
}
Пример #2
0
int
main(int argc, const char *argv[])
{
    int result = 0;
    apr_pool_t *mp;
    apr_status_t status;
    char next_char;
    Source *source = NULL;

    apr_initialize();

    status = apr_pool_create(&mp, NULL);
    handle_and_display_error(status);

    source_init(&source, mp);

    status = source_set_options(source, argc, argv, mp);
    handle_and_display_error(status);

    status = source_open(source, mp);
    handle_and_display_error(status);

    while (source_shift_character(source, &next_char) == APR_SUCCESS) {
        printf("%c", next_char);
    }

    goto cleanup;

error:
    result = 1;

cleanup:
    if (source) { source_cleanup(source); }
    apr_pool_destroy(mp);
    apr_terminate();

    return result;
}