Ejemplo n.º 1
0
void   free_engine(engine_t *e)
{
	assert(e);
	assert(*e);
	mutex_destroy(&(*e)->mtx);
	LIST_DESTROY(&(*e)->buffering_event_queue);
	LIST_DESTROY(&(*e)->block_thread_queue);
	free(*e);
	*e = 0;
}
Ejemplo n.º 2
0
extern "C" int __cdecl LIST_CREATE(LPCTSTR title, int match_mode)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	CTtHideToolsApp* app = (CTtHideToolsApp*)AfxGetApp();
	if(app->m_EditListDialog) LIST_DESTROY();
	app->m_PatternMatch = new CPatternMatch(match_mode);
	app->m_EditListDialog = new CEditListDialog(NULL, app->m_PatternMatch);
	app->m_EditListDialog->m_Title = title;
	return 1;
}
Ejemplo n.º 3
0
int main( int argc, char** argv) {

    if (argc < 2) return 0;

    if (strcmpi(argv[1], "parsing") == 0) {

        string_list arguments;
        trax_properties* properties;
        int input;
        int output = fileno(stdout);

        if (argc != 3) return 0;

        input = open(argv[2], O_RDONLY);

        LIST_CREATE(arguments, 8);
        properties = trax_properties_create();

        message_stream* stream = create_message_stream_file(input, output);

        while (1) {

            int type;

            LIST_RESET(arguments);
            trax_properties_clear(properties);

            type = read_message(stream, NULL, &arguments, properties);

            if (type == TRAX_ERROR) break;

            write_message(stream, NULL, type, arguments, properties); 

        }

        close(input);

        LIST_DESTROY(arguments);
        trax_properties_release(&properties);

        destroy_message_stream(&stream);

    }

}
Ejemplo n.º 4
0
Archivo: test.c Proyecto: Petititi/trax
int main( int argc, char** argv) {

    if (argc < 2) return 0;

    if (strcmpi(argv[1], "parsing") == 0) {

        string_list arguments;
        trax_properties* properties;
        FILE* input;

        if (argc != 3) return 0;

        input = fopen(argv[2], "r");

        LIST_CREATE(arguments, 8);
        properties = trax_properties_create();

        while (1) {

            int type;

            LIST_RESET(arguments);
            trax_properties_clear(properties);

            type = read_message(input, NULL, &arguments, properties);

            if (type == TRAX_ERROR) break;

            write_message(stdout, NULL, type, arguments, properties); 

        }

        fclose(input);

        LIST_DESTROY(arguments);
        trax_properties_release(&properties);

    }

}