• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ CallFunction函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: pkcs11_C_GetSlotList

static VALUE
pkcs11_C_GetSlotList(VALUE self, VALUE presented)
{
  CK_ULONG ulSlotCount;
  CK_SLOT_ID_PTR pSlotList;
  CK_RV rv;
  CK_C_GetSlotList func;
  CK_ULONG i;
  VALUE ary = rb_ary_new();

  GetFunction(self, C_GetSlotList, func);
  CallFunction(C_GetSlotList, func, rv, CK_FALSE, NULL_PTR, &ulSlotCount);
  if (rv != CKR_OK) pkcs11_raise(self,rv);
  pSlotList = (CK_SLOT_ID_PTR)malloc(ulSlotCount*sizeof(CK_SLOT_ID));
  CallFunction(C_GetSlotList, func, rv, RTEST(presented) ? CK_TRUE : CK_FALSE, pSlotList, &ulSlotCount);
  if (rv != CKR_OK) {
    free(pSlotList);
    pkcs11_raise(self,rv);
  }
  for (i = 0; i < ulSlotCount; i++)
    rb_ary_push(ary, HANDLE2NUM(pSlotList[i]));
  free(pSlotList);

  return ary;
}
开发者ID:cprice404,项目名称:pkcs11,代码行数:25,代码来源:pk11.c


示例2: pkcs11_C_GetMechanismList

static VALUE
pkcs11_C_GetMechanismList(VALUE self, VALUE slot_id)
{
  CK_RV rv;
  CK_C_GetMechanismList func;
  CK_MECHANISM_TYPE_PTR types;
  CK_ULONG count;
  VALUE ary;
  CK_ULONG i;

  ary = rb_ary_new();
  GetFunction(self, C_GetMechanismList, func);
  CallFunction(C_GetMechanismList, func, rv, NUM2HANDLE(slot_id), NULL_PTR, &count);
  if (rv != CKR_OK) pkcs11_raise(self,rv);
  if (count == 0) return ary;

  types = (CK_MECHANISM_TYPE_PTR)malloc(sizeof(CK_MECHANISM_TYPE)*count);
  if (!types) rb_sys_fail(0);
  CallFunction(C_GetMechanismList, func, rv, NUM2HANDLE(slot_id), types, &count);
  if (rv != CKR_OK){
    free(types);
    pkcs11_raise(self,rv);
  }
  for (i = 0; i < count; i++)
    rb_ary_push(ary, HANDLE2NUM(*(types+i)));
  free(types);

  return ary;
}
开发者ID:cprice404,项目名称:pkcs11,代码行数:29,代码来源:pk11.c


示例3: distRight

 double Cell_t::GetWidth(const XlfOper& ref)
 {
     // there is no get width function so we work it
     // out using the distances from far left
     double distRight(CallFunction(xlfGetCell, 44, ref, "Get Right Position").AsDouble());
     double distLeft(CallFunction(xlfGetCell, 42, ref, "Get Left Position").AsDouble());
     return distRight - distLeft;
 }
开发者ID:quant911,项目名称:xlw518,代码行数:8,代码来源:XlfServices.cpp


示例4: CallFunction

 XlfOper Notes_t::GetNote(const XlfOper& cellRef, int startCharacter, int numChars)
 {
     if(numChars == 0)
     {
         return CallFunction(xlfGetNote, cellRef, startCharacter + 1, "Get Note");
     }
     else
     {
         return CallFunction(xlfGetNote, cellRef, startCharacter + 1, numChars, "Get Note");
     }
 }
开发者ID:quant911,项目名称:xlw518,代码行数:11,代码来源:XlfServices.cpp


示例5: Lock

bool cPlugin_NewLua::OnExecuteCommand(cPlayer * a_Player, const AStringVector & a_Split)
{
	cCSLock Lock(m_CriticalSection);
	const char * FnName = GetHookFnName(cPluginManager::HOOK_EXECUTE_COMMAND);
	ASSERT(FnName != NULL);
	if (!PushFunction(FnName))
	{
		return false;
	}

	tolua_pushusertype(m_LuaState, a_Player, "cPlayer");

	// Push the split:
	lua_createtable(m_LuaState, a_Split.size(), 0);
	int newTable = lua_gettop(m_LuaState);
	int index = 1;
	std::vector<std::string>::const_iterator iter = a_Split.begin(), end = a_Split.end();
	while(iter != end)
	{
		tolua_pushstring(m_LuaState, (*iter).c_str());
		lua_rawseti(m_LuaState, newTable, index);
		++iter;
		++index;
	}

	if (!CallFunction(2, 1, FnName))
	{
		return false;
	}

	bool bRetVal = (tolua_toboolean(m_LuaState, -1, 0) > 0);
	lua_pop(m_LuaState, 1);
	return bRetVal;
}
开发者ID:l0ud,项目名称:MCServer,代码行数:34,代码来源:Plugin_NewLua.cpp


示例6: pkcs11_C_GetFunctionList

/*
 * Obtains a pointer to the Cryptoki library's list of function pointers. The pointer
 * is stored in the {PKCS11::Library} object and used to call any Cryptoki functions.
 *
 * @see PKCS11::Library#initialize
 */
static VALUE
pkcs11_C_GetFunctionList(VALUE self)
{
  pkcs11_ctx *ctx;
  CK_RV rv;
  CK_C_GetFunctionList func;

  Data_Get_Struct(self, pkcs11_ctx, ctx);
#ifdef compile_for_windows
  func = (CK_C_GetFunctionList)GetProcAddress(ctx->module, "C_GetFunctionList");
  if(!func){
    char error_text[999] = "GetProcAddress() error";
    FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_MAX_WIDTH_MASK,
                NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
                (LPTSTR)&error_text, sizeof(error_text), NULL);
    rb_raise(ePKCS11Error, "%s", error_text);
  }
#else
  func = (CK_C_GetFunctionList)dlsym(ctx->module, "C_GetFunctionList");
  if(!func) rb_raise(ePKCS11Error, "%s", dlerror());
#endif
  CallFunction(C_GetFunctionList, func, rv, &(ctx->functions));
  if (rv != CKR_OK) pkcs11_raise(self,rv);

  return self;
}
开发者ID:cprice404,项目名称:pkcs11,代码行数:32,代码来源:pk11.c


示例7: TestConstructorDestructor

void TestConstructorDestructor(clcpp::Database& db)
{
	const clcpp::Class* ca = clcpp::GetType<TestClassImpl::A>()->AsClass();
	const clcpp::Class* cb = clcpp::GetType<TestClassImpl::B>()->AsClass();

	TestClassImpl::A* a = (TestClassImpl::A*)new char[sizeof(TestClassImpl::A)];
	TestClassImpl::B* b = (TestClassImpl::B*)new char[sizeof(TestClassImpl::B)];

	CallFunction(ca->constructor, a);
	CallFunction(cb->constructor, b);

	CallFunction(ca->destructor, a);
	CallFunction(cb->destructor, b);

	delete [] (char*) a;
	delete [] (char*) b;
}
开发者ID:Celtoys,项目名称:clReflect,代码行数:17,代码来源:TestClassImpl.cpp


示例8: CallFunction

unsigned int YouTubeWebPageView::GetVideoBytesTotal()
{
   CComVariant varResult;
   CallFunction(_T("getVideoBytesTotal"), std::vector<CComVariant>(), varResult);

   ATLASSERT(varResult.vt == VT_I4);
   return varResult.intVal;
}
开发者ID:vividos,项目名称:PartyVideoDJ,代码行数:8,代码来源:YouTubeWebPageView.cpp


示例9: CallFunction

clcpp::ReadIterator::~ReadIterator()
{
	// Destruct the read iterator
	if (m_IteratorImplType != 0)
		CallFunction(m_IteratorImplType->destructor, (IReadIterator*)m_ImplData);
	else
		clcpp::internal::CallDestructor((ArrayReadIterator*)m_ImplData);
}
开发者ID:Celtoys,项目名称:clReflect,代码行数:8,代码来源:Containers.cpp


示例10: FnCallEvaluate

FnCallResult FnCallEvaluate(EvalContext *ctx, FnCall *fp, const Promise *caller)
{
    Rlist *expargs;
    const FnCallType *fp_type = FnCallTypeGet(fp->name);

    if (fp_type)
    {
        if (DEBUG)
        {
            printf("EVALUATE FN CALL %s\n", fp->name);
            FnCallShow(stdout, fp);
            printf("\n");
        }
    }
    else
    {
        if (caller)
        {
            CfOut(OUTPUT_LEVEL_ERROR, "", "No such FnCall \"%s()\" in promise @ %s near line %zd\n",
                  fp->name, PromiseGetBundle(caller)->source_path, caller->offset.line);
        }
        else
        {
            CfOut(OUTPUT_LEVEL_ERROR, "", "No such FnCall \"%s()\" - context info unavailable\n", fp->name);
        }

        return (FnCallResult) { FNCALL_FAILURE, { FnCallCopy(fp), RVAL_TYPE_FNCALL } };
    }

/* If the container classes seem not to be defined at this stage, then don't try to expand the function */

    if ((caller != NULL) && !IsDefinedClass(ctx, caller->classes, PromiseGetNamespace(caller)))
    {
        return (FnCallResult) { FNCALL_FAILURE, { FnCallCopy(fp), RVAL_TYPE_FNCALL } };
    }

    expargs = NewExpArgs(ctx, fp, caller);

    if (UnresolvedArgs(expargs))
    {
        DeleteExpArgs(expargs);
        return (FnCallResult) { FNCALL_FAILURE, { FnCallCopy(fp), RVAL_TYPE_FNCALL } };
    }

    fp->caller = caller;

    FnCallResult result = CallFunction(ctx, fp_type, fp, expargs);

    if (result.status == FNCALL_FAILURE)
    {
        /* We do not assign variables to failed function calls */
        DeleteExpArgs(expargs);
        return (FnCallResult) { FNCALL_FAILURE, { FnCallCopy(fp), RVAL_TYPE_FNCALL } };
    }

    DeleteExpArgs(expargs);
    return result;
}
开发者ID:shaunamarie,项目名称:core,代码行数:58,代码来源:fncall.c


示例11: CallFunction

cLuaInterpreter::~cLuaInterpreter()
{
	char * args[] = { NULL };
	if(mL) {
		CallFunction("UnLoad", args);
		lua_close(mL);
	}
	clean();
}
开发者ID:asshole52,项目名称:verlihub,代码行数:9,代码来源:cluainterpreter.cpp


示例12: pkcs11_C_GetOperationState

static VALUE
pkcs11_C_GetOperationState(VALUE self, VALUE session)
{
  CK_RV rv;
  CK_C_GetOperationState func;
  VALUE state;
  CK_ULONG size;

  GetFunction(self, C_GetOperationState, func);
  CallFunction(C_GetOperationState, func, rv, NUM2HANDLE(session), NULL_PTR, &size);
  if (rv != CKR_OK) pkcs11_raise(self,rv);
  state = rb_str_new(0, size);
  CallFunction(C_GetOperationState, func, rv, NUM2HANDLE(session), (CK_BYTE_PTR)RSTRING_PTR(state), &size);
  if (rv != CKR_OK) pkcs11_raise(self,rv);
  rb_str_set_len(state, size);

  return state;
}
开发者ID:cprice404,项目名称:pkcs11,代码行数:18,代码来源:pk11.c


示例13: EvaluateFunctionCall

FnCallResult EvaluateFunctionCall(FnCall *fp, Promise *pp)
{
    Rlist *expargs;
    const FnCallType *this = FindFunction(fp->name);

    if (this)
    {
        if (DEBUG)
        {
            printf("EVALUATE FN CALL %s\n", fp->name);
            ShowFnCall(stdout, fp);
            printf("\n");
        }
    }
    else
    {
        if (pp)
        {
            CfOut(cf_error, "", "No such FnCall \"%s()\" in promise @ %s near line %zd\n",
                  fp->name, pp->audit->filename, pp->offset.line);
        }
        else
        {
            CfOut(cf_error, "", "No such FnCall \"%s()\" - context info unavailable\n", fp->name);
        }

        return (FnCallResult) { FNCALL_FAILURE, { CopyFnCall(fp), CF_FNCALL } };
    }

/* If the container classes seem not to be defined at this stage, then don't try to expand the function */

    if ((pp != NULL) && !IsDefinedClass(pp->classes))
    {
        return (FnCallResult) { FNCALL_FAILURE, { CopyFnCall(fp), CF_FNCALL } };
    }

    expargs = NewExpArgs(fp, pp);

    if (UnresolvedArgs(expargs))
    {
        DeleteExpArgs(expargs);
        return (FnCallResult) { FNCALL_FAILURE, { CopyFnCall(fp), CF_FNCALL } };
    }

    FnCallResult result = CallFunction(this, fp, expargs);

    if (result.status == FNCALL_FAILURE)
    {
        /* We do not assign variables to failed function calls */
        DeleteExpArgs(expargs);
        return (FnCallResult) { FNCALL_FAILURE, { CopyFnCall(fp), CF_FNCALL } };
    }

    DeleteExpArgs(expargs);
    return result;
}
开发者ID:joegen,项目名称:sipx-externals,代码行数:56,代码来源:fncall.c


示例14: CallFunction

// Calls a Lua function from a given keyname
bool _Scripting::HandleKeyPress(int Key) {

	// Find function
	KeyCallbacksIterator = KeyCallbacks.find(Key);
	if(KeyCallbacksIterator != KeyCallbacks.end()) {
		CallFunction(KeyCallbacksIterator->second);
		return true;
	}

	return false;
}
开发者ID:vinjn,项目名称:irrlamb,代码行数:12,代码来源:scripting.cpp


示例15: COMPONENT_TRACE

TInt RTFDosExtension::CallSyncDosExtFunction( const TInt& aFunc, TAny* aParam = NULL, TInt aParLength = 0, TBool aAutoComplete = ETrue )
    {
    COMPONENT_TRACE( ( _L( "    DSYTESTTOOL - RTFDosExtension::CallSyncDosExtFunction(0x%x, 0x%x, 0x%x, 0x%x)" ), aFunc, aParam, aParLength, aAutoComplete ) );
    TExtensionParPckg package;
    package().iFunc = aFunc;
    package().iParLength = aParLength;
    package().iAutoComplete = aAutoComplete;
    TPtr8 ptr( ( TUint8* )aParam, aParLength, aParLength );
    TInt result = CallFunction( package, ptr );
    COMPONENT_TRACE( ( _L( "    DSYTESTTOOL - RTFDosExtension::CallSyncDosExtFunction - return 0x%x" ), result ) );
    return result;
    }
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:12,代码来源:tfdosservercontrol.cpp


示例16: pkcs11_C_CloseSession

static VALUE
pkcs11_C_CloseSession(VALUE self, VALUE session)
{
  CK_C_CloseSession func;
  CK_RV rv;

  GetFunction(self, C_CloseSession, func);
  CallFunction(C_CloseSession, func, rv, NUM2HANDLE(session));
  if(rv != CKR_OK) pkcs11_raise(self,rv);

  return self;
}
开发者ID:cprice404,项目名称:pkcs11,代码行数:12,代码来源:pk11.c


示例17: pkcs11_C_Finalize

/*
 * Is called to indicate that an application is finished with the Cryptoki library.
 * @see PKCS11::Library#close
 */
static VALUE
pkcs11_C_Finalize(VALUE self)
{
  CK_C_Finalize func;
  CK_RV rv;

  GetFunction(self, C_Finalize, func);
  CallFunction(C_Finalize, func, rv, NULL_PTR);
  if (rv != CKR_OK) pkcs11_raise(self,rv);

  return self;
}
开发者ID:cprice404,项目名称:pkcs11,代码行数:16,代码来源:pk11.c


示例18: pkcs11_C_CloseAllSessions

static VALUE
pkcs11_C_CloseAllSessions(VALUE self, VALUE slot_id)
{
  CK_C_CloseAllSessions func;
  CK_RV rv;

  GetFunction(self, C_CloseAllSessions, func);
  CallFunction(C_CloseAllSessions, func, rv, NUM2HANDLE(slot_id));
  if(rv != CKR_OK) pkcs11_raise(self,rv);

  return self;
}
开发者ID:cprice404,项目名称:pkcs11,代码行数:12,代码来源:pk11.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CallGetService函数代码示例发布时间:2022-05-30
下一篇:
C++ CallEvent函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap