Beispiel #1
0
/* Parse an IDL file */
int idl_loadFile(cx_string file, int argc, char* argv[], void* udata) {
    idl_Parser p;
    CX_UNUSED(udata);
    CX_UNUSED(argc);
    CX_UNUSED(argv);

    /* Parse IDL */
    p = idl_ParserCreate(file, NULL);
    if (!p) {
        goto error;
    }
    
    idl_Parser_parse(p);
    cx_release(p);

    return 0;
error:
    return -1;
}
Beispiel #2
0
/* test_Simple.c
 *
 * This file contains the implementation for the generated interface.
 *
 * Don't mess with the begin and end tags, since these will ensure that modified
 * code in interface functions isn't replaced when code is re-generated.
 */

#define test_LIB
#include "test.h"

/* ::test::Simple::setup() */
cx_void _test_Simple_setup(test_Simple this) {
/* $begin(::test::Simple::setup) */

    this->p = idl_ParserCreate("idl/simple.idl", NULL);
    test_assert(this->p != NULL);
    cx_int16 ret = idl_Parser_parse(this->p);
    test_assert(ret == 0);

/* $end */
}

/* ::test::Simple::tc_point() */
cx_void _test_Simple_tc_point(test_Simple this) {
/* $begin(::test::Simple::tc_point) */

    cx_object s = cx_resolve(NULL, "Point");
    test_assert(s != NULL);
    test_assert(cx_typeof(s) == cx_type(cx_struct_o));
Beispiel #3
0
/* test_Sequence.c
 *
 * This file contains the implementation for the generated interface.
 *
 * Don't mess with the begin and end tags, since these will ensure that modified
 * code in interface functions isn't replaced when code is re-generated.
 */

#define test_LIB
#include "test.h"

/* ::test::Sequence::setup() */
cx_void _test_Sequence_setup(test_Sequence this) {
/* $begin(::test::Sequence::setup) */

    this->p = idl_ParserCreate("idl/sequence.idl", NULL);
    test_assert(this->p != NULL);
    cx_int16 ret = idl_Parser_parse(this->p);
    test_assert(ret == 0);

/* $end */
}

/* ::test::Sequence::tc_sequence() */
cx_void _test_Sequence_tc_sequence(test_Sequence this) {
/* $begin(::test::Sequence::tc_sequence) */

    cx_object s = cx_resolve(NULL, "Sequences");
    test_assert(s != NULL);
    test_assert(cx_typeof(s) == cx_type(cx_struct_o));
Beispiel #4
0
/* test_Comments.c
 *
 * This file contains the implementation for the generated interface.
 *
 * Don't mess with the begin and end tags, since these will ensure that modified
 * code in interface functions isn't replaced when code is re-generated.
 */

#define test_LIB
#include "test.h"

/* ::test::Comments::tc_comments() */
cx_void _test_Comments_tc_comments(test_Comments this) {
/* $begin(::test::Comments::tc_comments) */

    this->p = idl_ParserCreate("idl/comments.idl", NULL);
    test_assert(this->p != NULL);
    cx_int16 ret = idl_Parser_parse(this->p);
    test_assert(ret == 0);

/* $end */
}
Beispiel #5
0
/* $CORTO_GENERATED
 *
 * Nested.c
 *
 * Only code written between the begin and end tags will be preserved
 * when the file is regenerated.
 */

#include "test.h"

corto_void _test_Nested_setup(test_Nested this) {
/* $begin(test/Nested/setup) */

    this->p = idl_ParserCreate("idl/nested.idl", NULL);
    test_assert(this->p != NULL);
    corto_int16 ret = idl_Parser_parse(this->p);
    test_assert(ret == 0);

/* $end */
}

corto_void _test_Nested_tc_nestedStruct(test_Nested this) {
/* $begin(test/Nested/tc_nestedStruct) */

    corto_object p = corto_resolve(NULL, "Parent");
    test_assert(p != NULL);
    test_assert(corto_typeof(p) == corto_type(corto_struct_o));

    corto_object n = corto_resolve(NULL, "Parent::NestedStruct");
    test_assert(n != NULL);
    test_assert(corto_typeof(n) == corto_type(corto_struct_o));