本文整理汇总了C++中GET_HANDLE函数的典型用法代码示例。如果您正苦于以下问题:C++ GET_HANDLE函数的具体用法?C++ GET_HANDLE怎么用?C++ GET_HANDLE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GET_HANDLE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: r_get_mem
char SeniorVMHandle::pop_operand( pVOperand o )
{
if (o == NULL)
{
return 0;
}
if (o->is_mem( ))
{
r_get_mem( o->_mem.base,o->_mem.index,o->_mem.scale,o->_mem.lval );
switch (o->_mem.size )
{
case 1:
db( GET_HANDLE( b_write_mem ) );
return 1;
break;
case 2:
db( GET_HANDLE( w_write_mem ) );
return 2;
break;
case 4:
db( GET_HANDLE( d_write_mem ) );
return 4;
break;
#ifdef PROTECT_X64
case 8:
db( GET_HANDLE( q_write_mem ) );
return 8;
break;
#endif
}
} else if (o->is_reg( ))
{
pop( o->_reg.base );
if (o->_reg.base & T_E32X)
{
return 4;
} else if (o->_reg.base & T_16X)
{
return 2;
} else if ( o->_reg.base & T_8L || o->_reg.base & T_8H)
{
return 1;
} else
return 8;
} else if (o->is_none( ))
{
return 0;
}
else {
cout << "未知操作数\r\n" << endl;
throw;
return -1;
}
return 0;
}
示例2: krb5_ldap_delete_krbcontainer
krb5_error_code
krb5_ldap_delete_krbcontainer(krb5_context context, const char *dn)
{
LDAP *ld=NULL;
krb5_error_code st=0;
kdb5_dal_handle *dal_handle=NULL;
krb5_ldap_context *ldap_context=NULL;
krb5_ldap_server_handle *ldap_server_handle=NULL;
SETUP_CONTEXT ();
/* get ldap handle */
GET_HANDLE ();
if (dn == NULL) {
st = EINVAL;
k5_setmsg(context, st, _("Kerberos Container information is missing"));
goto cleanup;
}
/* delete the kerberos container */
if ((st = ldap_delete_ext_s(ld, dn, NULL, NULL)) != LDAP_SUCCESS) {
int ost = st;
st = translate_ldap_error (st, OP_ADD);
k5_setmsg(context, st, _("Kerberos Container delete FAILED: %s"),
ldap_err2string(ost));
goto cleanup;
}
cleanup:
krb5_ldap_put_handle_to_pool(ldap_context, ldap_server_handle);
return(st);
}
示例3: GET_HANDLE
int VPLHttp2__Impl::Put(const std::string &reqBodyFilePath,
VPLHttp2_ProgressCb sendProgCb,
void *sendProgCtx,
std::string &respBody)
{
int rv = 0;
GET_HANDLE(&(this->mutex), this->handleInUse);
setMethod(PUT);
rv = sendFromFile(reqBodyFilePath);
if (rv == 0) {
rv = setupProgressCallback(sendProgCb, sendProgCtx);
}
if (rv == 0) {
rv = recvToString(respBody);
}
if (rv == 0) {
rv = connect();
}
PUT_HANDLE(&(this->mutex), this->handleInUse);
return rv;
}
示例4: m2_mouseup
static RobWidget* m2_mouseup(RobWidget* handle, RobTkBtnEvent *event) {
MF2UI* ui = (MF2UI*)GET_HANDLE(handle);
ui->drag_cutoff_x = -1;
ui->update_annotations = true;
queue_draw(ui->m2);
return NULL;
}
示例5: Java_org_a11y_BrlAPI_Native_getDisplaySize
JNIEXPORT jobject JNICALL Java_org_a11y_BrlAPI_Native_getDisplaySize(JNIEnv *jenv, jobject jobj) {
unsigned int x, y;
jclass jcsize;
jmethodID jinit;
jobject jsize;
GET_HANDLE(jenv, jobj, NULL);
env = jenv;
if (brlapi__getDisplaySize(handle, &x, &y) < 0) {
ThrowError(jenv, __func__);
return NULL;
}
if (!(jcsize = (*jenv)->FindClass(jenv, "org/a11y/BrlAPI/DisplaySize"))) {
ThrowException(jenv, ERR_NULLPTR, __func__);
return NULL;
}
if (!(jinit = (*jenv)->GetMethodID(jenv, jcsize, "<init>", "(II)V"))) {
ThrowException(jenv, ERR_NULLPTR, __func__);
return NULL;
}
if (!(jsize = (*jenv)->NewObject(jenv, jcsize, jinit, x, y))) {
ThrowException(jenv, ERR_NULLPTR, __func__);
return NULL;
}
return jsize;
}
示例6: Java_org_a11y_BrlAPI_Native_enterTtyMode
JNIEXPORT jint JNICALL Java_org_a11y_BrlAPI_Native_enterTtyMode(JNIEnv *jenv, jobject jobj, jint jtty, jstring jdriver) {
int tty ;
char *driver;
int result;
GET_HANDLE(jenv, jobj, -1);
env = jenv;
tty = (int)jtty;
if (!jdriver)
driver = NULL;
else
if (!(driver = (char *)(*jenv)->GetStringUTFChars(jenv, jdriver, NULL))) {
ThrowException(jenv, ERR_OUTOFMEM, __func__);
return -1;
}
result = brlapi__enterTtyMode(handle, tty,driver);
if (result < 0) {
ThrowError(jenv, __func__);
return -1;
}
return (jint) result;
}
示例7: q_push_imm
void SeniorVMHandle::q_not_and(long _register1,long _register2,bool is_data)
{
if (is_data)
{
q_push_imm( _register2 );
push( _register1 );
db( GET_HANDLE( q_nand ) );
return;
}
if (_register1 == 0 || _register2 == 0)
{
db(HANDLE.q_nand.handle);
return;
}
push(_register2,false);
//db(HANDLE.push_esp.handle);
//db(HANDLE.q_read_mem.handle);
//pop(_register2);
push(_register1,false);
//db(HANDLE.push_esp.handle);
//db(HANDLE.q_read_mem.handle);
//pop(_register1);
db(HANDLE.q_nand.handle);
}
示例8: native_compile
static void native_compile(JNIEnv* env, jobject object, jstring sqlString)
{
char buf[65];
strcpy(buf, "android_database_SQLiteProgram->native_compile() not implemented");
throw_sqlite3_exception(env, GET_HANDLE(env, object), buf);
return;
}
示例9: native_finalize
static void native_finalize(JNIEnv* env, jobject object)
{
char buf[66];
strcpy(buf, "com_sqlcrypt_database_SQLiteProgram->native_finalize() not implemented");
throw_sqlite3_exception(env, GET_HANDLE(env, object), buf);
return;
}
示例10: krb5_ldap_create_krbcontainer
krb5_error_code
krb5_ldap_create_krbcontainer(krb5_context context, const char *dn)
{
LDAP *ld=NULL;
char *strval[2]={NULL}, **rdns=NULL;
LDAPMod **mods = NULL;
krb5_error_code st=0;
kdb5_dal_handle *dal_handle=NULL;
krb5_ldap_context *ldap_context=NULL;
krb5_ldap_server_handle *ldap_server_handle=NULL;
SETUP_CONTEXT ();
/* get ldap handle */
GET_HANDLE ();
if (dn == NULL) {
st = EINVAL;
k5_setmsg(context, st, _("Kerberos Container information is missing"));
goto cleanup;
}
strval[0] = "krbContainer";
strval[1] = NULL;
if ((st=krb5_add_str_mem_ldap_mod(&mods, "objectclass", LDAP_MOD_ADD, strval)) != 0)
goto cleanup;
rdns = ldap_explode_dn(dn, 1);
if (rdns == NULL) {
st = EINVAL;
k5_setmsg(context, st, _("Invalid Kerberos container DN"));
goto cleanup;
}
strval[0] = rdns[0];
strval[1] = NULL;
if ((st=krb5_add_str_mem_ldap_mod(&mods, "cn", LDAP_MOD_ADD, strval)) != 0)
goto cleanup;
/* create the kerberos container */
st = ldap_add_ext_s(ld, dn, mods, NULL, NULL);
if (st == LDAP_ALREADY_EXISTS)
st = LDAP_SUCCESS;
if (st != LDAP_SUCCESS) {
int ost = st;
st = translate_ldap_error (st, OP_ADD);
k5_setmsg(context, st, _("Kerberos Container create FAILED: %s"),
ldap_err2string(ost));
goto cleanup;
}
cleanup:
if (rdns)
ldap_value_free (rdns);
ldap_mods_free(mods, 1);
krb5_ldap_put_handle_to_pool(ldap_context, ldap_server_handle);
return(st);
}
示例11: m2_leave
static void m2_leave(RobWidget *handle) {
MF2UI* ui = (MF2UI*)GET_HANDLE(handle);
if (ui->prelight_cutoff) {
ui->prelight_cutoff = false;
ui->update_annotations = true;
queue_draw(ui->m2);
}
}
示例12: d_push_imm
void SeniorVMHandle::set_key( long _key )
{
//recover_vm_context();
#ifndef PROTECT_X64
d_push_imm( _key );
#else
q_push_imm( _key );
#endif
db( GET_HANDLE( set_key ) );
}
示例13: m0_size_allocate
static void
m0_size_allocate (RobWidget* rw, int w, int h) {
BITui* ui = (BITui*)GET_HANDLE(rw);
robwidget_set_size (rw, w, h);
if (ui->m0_faceplate) {
cairo_surface_destroy (ui->m0_faceplate);
ui->m0_faceplate = NULL;
}
queue_draw (rw);
}
示例14: native_clear_bindings
static void native_clear_bindings(JNIEnv* env, jobject object)
{
int err;
sqlite3_stmt * statement = GET_STATEMENT(env, object);
err = sqlite3_clear_bindings(statement);
if (err != SQLITE_OK) {
throw_sqlite3_exception(env, GET_HANDLE(env, object));
return;
}
}
示例15: LOG_DEBUG
bool WeCacheServer::OnPacket(TCPSession *session, uint32_t cmd, const char *packet_data, uint32_t head_size, uint32_t body_size, uint64_t tid)
{
if(!HAS_HANDLE(cmd))
{
LOG_DEBUG(logger, "can't find handler for cmd="<<cmd<<".fd="<<session->GetFD());
//由父类来处理
return TCPServer::OnPacket(session, cmd, packet_data, head_size, body_size, tid);
}
HANDLER_PTR handler = GET_HANDLE(cmd);
int ret = (this->*handler)(session, packet_data, head_size, body_size, tid);
return ret==0?true:false;
}