当前位置: 首页>>代码示例>>C++>>正文


C++ CORBA_free函数代码示例

本文整理汇总了C++中CORBA_free函数的典型用法代码示例。如果您正苦于以下问题:C++ CORBA_free函数的具体用法?C++ CORBA_free怎么用?C++ CORBA_free使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了CORBA_free函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: pyorbit_poa_deactivate_object

static PyObject *
pyorbit_poa_deactivate_object(PyCORBA_Object *self, PyObject *args)
{
    CORBA_Environment ev;
    PortableServer_ObjectId *id;
    Py_ssize_t id_length;
    id = (PortableServer_ObjectId *)CORBA_sequence_CORBA_octet__alloc();
    id->_release = CORBA_FALSE;
    if (!PyArg_ParseTuple(args, "s#:POA.deactivate_object",
			  &id->_buffer, &id_length)) {
	CORBA_free(id);
	return NULL;
    }
    id->_length = id_length;
    id->_length++; /* account for nul termination */

    CORBA_exception_init(&ev);
    PortableServer_POA_deactivate_object((PortableServer_POA)self->objref,
					 id, &ev);
    CORBA_free(id);
    if (pyorbit_check_ex(&ev))
	return NULL;

    Py_INCREF(Py_None);
    return Py_None;
}
开发者ID:GNOME,项目名称:pyorbit,代码行数:26,代码来源:pyorbit-poa.c

示例2: dasher_action_speech_activate

static gboolean
dasher_action_speech_activate(DasherAction *pSelf) {
    DasherActionSpeechPrivate *pDasherActionSpeechPrivate = DASHER_ACTION_SPEECH_GET_PRIVATE(pSelf);

    pDasherActionSpeechPrivate->rv = 0;
    Bonobo_ServerInfoList *servers;
    Bonobo_ServerInfo *info;

    servers = bonobo_activation_query("repo_ids.has_one(['IDL:GNOME/Speech/SynthesisDriver:0.2','IDL:GNOME/Speech/SynthesisDriver:0.3'])", NULL, &(pDasherActionSpeechPrivate->ev));

    if(servers->_length == 0) {
        pDasherActionSpeechPrivate->speaker = NULL;
        printf(_("Unable to initialize speech support\n"));
        fflush(stdout);
        return false;
    }

    for(unsigned int i = 0; i < servers->_length; i++) {
        CORBA_exception_init(&(pDasherActionSpeechPrivate->ev));

        info = &servers->_buffer[i];

        pDasherActionSpeechPrivate->rv = bonobo_activation_activate_from_id((const Bonobo_ActivationID)info->iid, 0, NULL, &(pDasherActionSpeechPrivate->ev));
        if(!BONOBO_EX(&(pDasherActionSpeechPrivate->ev))) {
            break;
        }
    }

    CORBA_free(servers);

    GNOME_Speech_SynthesisDriver_driverInit(pDasherActionSpeechPrivate->rv, &(pDasherActionSpeechPrivate->ev));

    pDasherActionSpeechPrivate->voices = GNOME_Speech_SynthesisDriver_getAllVoices(pDasherActionSpeechPrivate->rv, &(pDasherActionSpeechPrivate->ev));

    if(pDasherActionSpeechPrivate->voices == NULL || BONOBO_EX(&(pDasherActionSpeechPrivate->ev)) || pDasherActionSpeechPrivate->voices->_length == 0) {
        g_warning(_("Unable to initialize voices\n"));
        pDasherActionSpeechPrivate->speaker = NULL;
        return false;
    }

    pDasherActionSpeechPrivate->speaker = GNOME_Speech_SynthesisDriver_createSpeaker(pDasherActionSpeechPrivate->rv, &pDasherActionSpeechPrivate->voices->_buffer[0], &(pDasherActionSpeechPrivate->ev));

    GNOME_Speech_ParameterList *list;
    list = GNOME_Speech_Speaker_getSupportedParameters(pDasherActionSpeechPrivate->speaker, &(pDasherActionSpeechPrivate->ev));
    if(BONOBO_EX(&(pDasherActionSpeechPrivate->ev)) || list->_length == 0) {
        if(!BONOBO_EX(&(pDasherActionSpeechPrivate->ev)))
            CORBA_free(list);
        g_warning(_("Warning: unable to set speech parameters\n"));
        return false;
    }
    for(unsigned i = 0; i < list->_length; i++) {
        GNOME_Speech_Parameter *p = &(list->_buffer[i]);
        if(!strcmp(p->name, "rate")) {
            GNOME_Speech_Speaker_setParameterValue(pDasherActionSpeechPrivate->speaker, p->name, 200.0, &(pDasherActionSpeechPrivate->ev));
        }
    }
    CORBA_free(list);

    return true;
}
开发者ID:rgee,项目名称:HFOSS-Dasher,代码行数:60,代码来源:dasher_action_speech.cpp

示例3: term_sequence_test

static int term_sequence_test(IC_Env *env)
{
    ETERM* et_array[4] = {
	erl_format("[{apa, 1, 23}, \"string\", {1.23, 45}]"),
	erl_format("[{banan, 1, 23}, \"string\", {1.23, 45}]"),
	erl_format("[{apelsin, 1, 23}, \"string\", {1.23, 45}]"),
	erl_format("[{mango, 1, 23}, \"string\", {1.23, 45}]")};
    m_etseq etsi = {4, 4, et_array}, *etso, *etsr;

    fprintf(stdout, "\n======== m_i_term_sequence test ======\n\n");
    etsr = m_i_term_sequence_test(NULL, &etsi, &etso, env);
    CHECK_EXCEPTION(env);
    RETURN_IF_OK(cmp_etseq(&etsi, etso) && cmp_etseq(&etsi, etsr));
    if (!cmp_etseq(&etsi, etso)) {
	fprintf(stdout, " out parameter error, sent:\n");
	print_etseq(&etsi);
	fprintf(stdout, "got:\n");
	print_etseq(etso);
    }
    if (!cmp_etseq(&etsi, etsr)) {
	fprintf(stdout, " result error, sent:\n");
	print_etseq(&etsi);
	fprintf(stdout, "got:\n");
	print_etseq(etsr);
    }
    free_etseq_buf(&etsi);
    free_etseq_buf(etso);
    free_etseq_buf(etsr);
    CORBA_free(etso);
    CORBA_free(etsr);
    return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:32,代码来源:c_client.c

示例4: seq1_test

static int seq1_test(IC_Env *env)
{
    m_bseq bs, *bso, *bsr;

    m_b ba[3] = {{4711, 'a'}, {4712, 'b'}, {4713, 'c'}};
    bs._length = 3;
    bs._buffer = ba;

    fprintf(stdout, "\n======== m_i_seq1 test ======\n\n");
    bsr = m_i_seq1_test(NULL, &bs, &bso, env);
    CHECK_EXCEPTION(env);
    RETURN_IF_OK(cmp_bseq(&bs, bso) && cmp_bseq(&bs, bsr));
    if (!cmp_bseq(&bs, bso)) {
	fprintf(stdout, " out parameter error, sent:\n");
	print_bseq(&bs);
	fprintf(stdout, " got:\n");
	print_bseq(bso);
	fprintf(stdout, "\n");
    }
    if (!cmp_bseq(&bs, bsr)) {
	fprintf(stdout, " result error, sent:\n");
	print_bseq(&bs);
	fprintf(stdout, " got:\n");
	print_bseq(bsr);
	fprintf(stdout, "\n");
    }
    CORBA_free(bso);
    CORBA_free(bsr);
    return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:30,代码来源:c_client.c

示例5: pyorbit_poa_activate_object_with_id

static PyObject *
pyorbit_poa_activate_object_with_id(PyCORBA_Object *self, PyObject *args)
{
    CORBA_Environment ev;
    PyPortableServer_Servant *pyservant;
    PortableServer_ServantBase *servant;
    PortableServer_ObjectId *id;
    Py_ssize_t id_length;

    id = (PortableServer_ObjectId *)CORBA_sequence_CORBA_octet__alloc();
    id->_release = CORBA_FALSE;
    if (!PyArg_ParseTuple(args, "s#O!:POA.activate_object_with_id",
			  &id->_buffer, &id_length,
			  &PyPortableServer_Servant_Type, &pyservant)) {
	CORBA_free(id);
	return NULL;
    }
    id->_length = id_length;
    id->_length++; /* account for nul termination */
    servant = PYSERVANT_TO_SERVANT(pyservant);

    CORBA_exception_init(&ev);
    PortableServer_POA_activate_object_with_id((PortableServer_POA)self->objref,
					       id, servant, &ev);
    CORBA_free(id);
    if (pyorbit_check_ex(&ev))
	return NULL;

    Py_INCREF(Py_None);
    return Py_None;
}
开发者ID:GNOME,项目名称:pyorbit,代码行数:31,代码来源:pyorbit-poa.c

示例6: seq4_test

static int seq4_test(IC_Env *env)
{
    char *stra0[3] = {"a", "long", "time"}; 
    char *stra1[3] = {"ago", "there", "was"}; 
    char *stra2[3] = {"a", "buggy", "compiler"}; 
    m_sstr3 str3s[3] = {{3, 3, stra0}, {3, 3, stra1}, {3, 3, stra2}};
    m_ssstr3 str3ssi = {3, 3, str3s}; 
    m_ssstr3 *str3sso, *str3ssr;

    fprintf(stdout, "\n======== m_i_seq4 test ======\n\n");
    str3ssr = m_i_seq4_test(NULL, &str3ssi, &str3sso, env);
    CHECK_EXCEPTION(env);
    RETURN_IF_OK(cmp_ssstr3(&str3ssi, str3sso) && 
		 cmp_ssstr3(&str3ssi, str3ssr));
    if (!cmp_ssstr3(&str3ssi, str3sso)){
	fprintf(stdout, " out parameter error, sent:\n");
	print_ssstr3(&str3ssi);
	fprintf(stdout, " got:\n");
	print_ssstr3(str3sso);
	fprintf(stdout, "\n");
    }
    if (!cmp_ssstr3(&str3ssi, str3ssr)) {
	fprintf(stdout, " result error, sent:\n");
	print_ssstr3(&str3ssi);
	fprintf(stdout, " got:\n");
	print_ssstr3(str3ssr);
	fprintf(stdout, "\n");
    }
    CORBA_free(str3sso);
    CORBA_free(str3ssr);
    return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:32,代码来源:c_client.c

示例7: seq3_test

static int seq3_test(IC_Env *env)
{
    m_lseq lsi, *lso, *lsr;
    long al[500];
    int i=0;
    
    for (i = 0; i < 500; i++)
	al[i]=i;
    lsi._length = 500;
    lsi._buffer = al;

    fprintf(stdout, "\n======== m_i_seq3 test ======\n\n");
    lsr = m_i_seq3_test(NULL, &lsi, &lso, env);
    CHECK_EXCEPTION(env);
    RETURN_IF_OK(cmp_lseq(&lsi, lso) && cmp_lseq(&lsi, lsr));
    if (!cmp_lseq(&lsi, lso)) {
	fprintf(stdout, " out parameter error, sent:\n");
	print_lseq(&lsi);
	fprintf(stdout, " got:\n");
	print_lseq(lso);
	fprintf(stdout, "\n");
    }
    if (!cmp_lseq(&lsi, lsr)) {
	fprintf(stdout, " result error, sent:\n");
	print_lseq(&lsi);
	fprintf(stdout, " got:\n");
	print_lseq(lsr);
	fprintf(stdout, "\n");
    }
    CORBA_free(lso);
    CORBA_free(lsr);
    return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:33,代码来源:c_client.c

示例8: inline_sequence_test

static int inline_sequence_test(IC_Env *env)
{
    int i;
    long al[500];
    m_s isi = {4711, {500, 10, al}},  
	*iso, *isr;

    for (i = 0; i < 500; i++)
	al[i]=i;
    fprintf(stdout, "\n======== m_i_inline_sequence test ======\n\n");
    isr = m_i_inline_sequence_test(NULL, &isi, &iso, env);
    CHECK_EXCEPTION(env);
    RETURN_IF_OK(cmp_s(&isi, iso) && cmp_s(&isi, isr));
    if (!cmp_s(&isi, iso)) {
	fprintf(stdout, " out parameter error, sent:\n");
	print_s(&isi);
	fprintf(stdout, "got:\n");
	print_s(iso);
    }
    if (!cmp_s(&isi, isr)) {
	fprintf(stdout, " result error, sent:\n");
	print_s(&isi);
	fprintf(stdout, "got:\n");
	print_s(isr);
    }
    CORBA_free(iso);
    CORBA_free(isr);
    return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:29,代码来源:c_client.c

示例9: seq5_test

static int seq5_test(IC_Env *env)
{
    m_arr3 arr3a[3] = {
	{4711, 18931947, 3}, 
	{4711, 18931947, 3},
	{4711, 18931947, 3}};
    m_sarr3 arr3sa[3] = {{3, 3, arr3a}, {3, 3, arr3a}, {3, 3, arr3a}};
    m_ssarr3 arr3ssi = {3, 3, arr3sa};
    m_ssarr3 *arr3sso;
    m_ssarr3 *arr3ssr;

    fprintf(stdout, "\n======== m_i_seq5 test ======\n\n");
    arr3ssr = m_i_seq5_test(NULL, &arr3ssi, &arr3sso, env);
    CHECK_EXCEPTION(env);
    RETURN_IF_OK(cmp_ssarr3(&arr3ssi, arr3sso) &&
		 cmp_ssarr3(&arr3ssi, arr3ssr));
    if (!cmp_ssarr3(&arr3ssi, arr3sso)) {
	fprintf(stdout, " out parameter error, sent:\n");
	print_ssarr3(&arr3ssi);
	fprintf(stdout, " got:\n");
	print_ssarr3(arr3sso);
	fprintf(stdout, "\n");
    }
    if (!cmp_ssarr3(&arr3ssi, arr3ssr)) {
	fprintf(stdout, " result error, sent:\n");
	print_ssarr3(&arr3ssi);
	fprintf(stdout, " got:\n");
	print_ssarr3(arr3ssr);
	fprintf(stdout, "\n");
    }
    CORBA_free(arr3sso);
    CORBA_free(arr3ssr);
    return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:34,代码来源:c_client.c

示例10: string2_test

static int string2_test(IC_Env *env)
{
    char* sa[3] = {"hello", "foo", "bar"};
    m_sseq ssi = {3, 3, sa};
    m_sseq *sso, *ssr;

    fprintf(stdout, "\n======== m_i_string2 test ======\n\n");
    ssr = m_i_string2_test(NULL, &ssi, &sso, env);
    CHECK_EXCEPTION(env);
    RETURN_IF_OK(cmp_sseq(&ssi, sso) && cmp_sseq(&ssi, sso));
    if (!cmp_sseq(&ssi, sso)) {
	fprintf(stdout, " out parameter error, sent:\n"); 
	print_sseq(&ssi); 
	fprintf(stdout, "got:\n");
	print_sseq(sso); 
    } 
    if (!cmp_sseq(&ssi, ssr)) {
	fprintf(stdout, " result error, sent:\n"); 
	print_sseq(&ssi); 
	fprintf(stdout, "got:\n"); 
	print_sseq(ssr); 
    }    
    CORBA_free(sso);
    CORBA_free(ssr);
    return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:26,代码来源:c_client.c

示例11: pyorbit_load_file

static PyObject *
pyorbit_load_file(PyObject *self, PyObject *args)
{
#ifdef HAVE_ORBIT2_IMODULE
    gchar *path, *cpp_args = "";
    CORBA_sequence_ORBit_IInterface *ifaces;
    CORBA_sequence_CORBA_TypeCode *types;

    if (!PyArg_ParseTuple(args, "s|s", &path, &cpp_args))
	return NULL;
    ifaces = ORBit_iinterfaces_from_file(path, cpp_args, &types);
    if (!ifaces) {
	PyErr_Format(PyExc_RuntimeError, "could not load '%s'", path);
	return NULL;
    }

    pyorbit_handle_types_and_interfaces(ifaces, types, path);

#if 0
    CORBA_free(ifaces);
    CORBA_free(types);
#endif

    Py_INCREF(Py_None);
    return Py_None;
#else
    PyErr_SetString(PyExc_RuntimeError,
		    "pyorbit was not configured with support for the "
		    "imodule service");
    return NULL;
#endif
}
开发者ID:GNOME,项目名称:pyorbit,代码行数:32,代码来源:ORBitmodule.c

示例12: test_ORBit_alloc

static void
test_ORBit_alloc (void)
{
	gpointer p;
	int      i;

	p = ORBit_alloc_string (100);
	g_assert ((gulong)p & 0x1);
	for (i = 0; i < 100; i++)
		((guchar *)p) [i] = i;
	CORBA_free (p);

	p = CORBA_string_dup ("Foo");
	g_assert (((gulong)p & 0x1));
	CORBA_free (p);

	p = ORBit_alloc_simple (100);
	g_assert (!((gulong)p & 0x1));
	for (i = 0; i < 100; i++)
		((guchar *)p) [i] = i;
	CORBA_free (p);

	p = ORBit_alloc_tcval (TC_CORBA_sequence_CORBA_octet, 1);
	g_assert (!((gulong)p & 0x1));
	CORBA_free (p);

	p = ORBit_alloc_tcval (TC_ORBit_IInterface, 8);
	g_assert (!((gulong)p & 0x1));
	CORBA_free (p);
}
开发者ID:OS2World,项目名称:SYSTEM-OS-Voyager,代码行数:30,代码来源:test-mem.c

示例13: CORBA_Environment_free

/* NOT EXPORTED SO FAR */
void CORBA_Environment_free(CORBA_Environment *env)
{

    CORBA_free(env->_inbuf);
    CORBA_free(env->_outbuf);
    CORBA_exception_free(env);
    CORBA_free(env);
} 
开发者ID:0x00evil,项目名称:otp,代码行数:9,代码来源:ic.c

示例14: client_exit

/* Stopping node */
void client_exit(CORBA_Environment *env) {

    /* Free env & buffers */
    CORBA_free(env->_inbuf);
    CORBA_free(env->_outbuf);
    CORBA_free(env);

    close(env->_fd);
    exit(1);
}
开发者ID:0x00evil,项目名称:otp,代码行数:11,代码来源:client.c

示例15: CORBA_exception_free

void CORBA_exception_free(CORBA_Environment *env)
{
 
    /* Setting major value */
    env->_major=CORBA_NO_EXCEPTION;

    /* Freeing storage */
    CORBA_free(env->_exc_id);
    CORBA_free(env->_exc_value);
    env->_exc_id = env->_exc_value = NULL;
}
开发者ID:0x00evil,项目名称:otp,代码行数:11,代码来源:ic.c


注:本文中的CORBA_free函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。