您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ API_END_RET函数代码示例

51自学网 2021-06-01 19:35:18
  C++
这篇教程C++ API_END_RET函数代码示例写得很实用,希望能帮到您。

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

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

示例1: __curmetadata_update

/* * __curmetadata_update -- *	WT_CURSOR->update method for the metadata cursor type. */static int__curmetadata_update(WT_CURSOR *cursor){	WT_CURSOR *file_cursor;	WT_CURSOR_METADATA *mdc;	WT_DECL_RET;	WT_SESSION_IMPL *session;	mdc = (WT_CURSOR_METADATA *)cursor;	file_cursor = mdc->file_cursor;	CURSOR_API_CALL(cursor, session,	    update, ((WT_CURSOR_BTREE *)file_cursor)->btree);	WT_MD_CURSOR_NEEDKEY(cursor);	WT_MD_CURSOR_NEEDVALUE(cursor);	/*	 * Since the key/value formats are 's' the WT_ITEMs must contain a	 * NULL terminated string.	 */	ret =	    __wt_metadata_update(session, cursor->key.data, cursor->value.data);err:	API_END_RET(session, ret);}
开发者ID:EaseTech,项目名称:wiredtiger,代码行数:29,


示例2: __curds_close

/* * __curds_close -- *	WT_CURSOR.close method for the data-source cursor type. */static int__curds_close(WT_CURSOR *cursor){	WT_CURSOR_DATA_SOURCE *cds;	WT_DECL_RET;	WT_SESSION_IMPL *session;	cds = (WT_CURSOR_DATA_SOURCE *)cursor;	CURSOR_API_CALL(cursor, session, close, NULL);	if (cds->source != NULL)		ret = cds->source->close(cds->source);	if (cds->collator_owned) {		if (cds->collator->terminate != NULL)			WT_TRET(cds->collator->terminate(			    cds->collator, &session->iface));		cds->collator_owned = 0;	}	cds->collator = NULL;	/*	 * The key/value formats are in allocated memory, which isn't standard	 * behavior.	 */	__wt_free(session, cursor->key_format);	__wt_free(session, cursor->value_format);	WT_TRET(__wt_cursor_close(cursor));err:	API_END_RET(session, ret);}
开发者ID:adityavs,项目名称:wiredtiger,代码行数:37,


示例3: __curmetadata_prev

/* * __curmetadata_prev -- *	WT_CURSOR->prev method for the metadata cursor type. */static int__curmetadata_prev(WT_CURSOR *cursor){	WT_CURSOR *file_cursor;	WT_CURSOR_METADATA *mdc;	WT_DECL_RET;	WT_SESSION_IMPL *session;	mdc = (WT_CURSOR_METADATA *)cursor;	file_cursor = mdc->file_cursor;	CURSOR_API_CALL(cursor, session,	    prev, ((WT_CURSOR_BTREE *)file_cursor)->btree);	if (F_ISSET(mdc, WT_MDC_ONMETADATA)) {		ret = WT_NOTFOUND;		goto err;	}	ret = file_cursor->prev(file_cursor);	if (ret == 0) {		WT_MD_SET_KEY_VALUE(cursor, mdc, file_cursor);	} else if (ret == WT_NOTFOUND)		WT_ERR(__curmetadata_metadata_search(session, cursor));err:	if (ret != 0) {		F_CLR(mdc, WT_MDC_POSITIONED | WT_MDC_ONMETADATA);		F_CLR(cursor, WT_CURSTD_KEY_EXT | WT_CURSTD_VALUE_EXT);	}	API_END_RET(session, ret);}
开发者ID:EaseTech,项目名称:wiredtiger,代码行数:34,


示例4: __curmetadata_search_near

/* * __curmetadata_search_near -- *	WT_CURSOR->search_near method for the metadata cursor type. */static int__curmetadata_search_near(WT_CURSOR *cursor, int *exact){	WT_CURSOR *file_cursor;	WT_CURSOR_METADATA *mdc;	WT_DECL_RET;	WT_SESSION_IMPL *session;	mdc = (WT_CURSOR_METADATA *)cursor;	file_cursor = mdc->file_cursor;	CURSOR_API_CALL(cursor, session,	    search_near, ((WT_CURSOR_BTREE *)file_cursor)->btree);	WT_MD_CURSOR_NEEDKEY(cursor);	if (WT_KEY_IS_METADATA(&cursor->key)) {		WT_ERR(__curmetadata_metadata_search(session, cursor));		*exact = 1;	} else {		WT_ERR(file_cursor->search_near(file_cursor, exact));		WT_MD_SET_KEY_VALUE(cursor, mdc, file_cursor);	}err:	if (ret != 0) {		F_CLR(mdc, WT_MDC_POSITIONED | WT_MDC_ONMETADATA);		F_CLR(cursor, WT_CURSTD_KEY_EXT | WT_CURSTD_VALUE_EXT);	}	API_END_RET(session, ret);}
开发者ID:EaseTech,项目名称:wiredtiger,代码行数:33,


示例5: __curjoin_extract_insert

/* * __curjoin_extract_insert -- *	Handle a key produced by a custom extractor. */static int__curjoin_extract_insert(WT_CURSOR *cursor){	WT_CURJOIN_EXTRACTOR *cextract;	WT_DECL_RET;	WT_ITEM ikey;	WT_SESSION_IMPL *session;	/*	 * This insert method may be called multiple times during a single	 * extraction.  If we already have a definitive answer to the	 * membership question, exit early.	 */	cextract = (WT_CURJOIN_EXTRACTOR *)cursor;	if (cextract->ismember)		return (0);	CURSOR_API_CALL(cursor, session, insert, NULL);	WT_ITEM_SET(ikey, cursor->key);	/*	 * We appended a padding byte to the key to avoid rewriting the last	 * column.  Strip that away here.	 */	WT_ASSERT(session, ikey.size > 0);	--ikey.size;	ret = __curjoin_entry_in_range(session, cextract->entry, &ikey, false);	if (ret == WT_NOTFOUND)		ret = 0;	else if (ret == 0)		cextract->ismember = true;err:	API_END_RET(session, ret);}
开发者ID:mongodb,项目名称:mongo,代码行数:39,


示例6: __curlog_close

/* * __curlog_close -- *	WT_CURSOR.close method for the log cursor type. */static int__curlog_close(WT_CURSOR *cursor){	WT_CONNECTION_IMPL *conn;	WT_CURSOR_LOG *cl;	WT_DECL_RET;	WT_LOG *log;	WT_SESSION_IMPL *session;	CURSOR_API_CALL(cursor, session, close, NULL);	cl = (WT_CURSOR_LOG *)cursor;	conn = S2C(session);	WT_ASSERT(session, FLD_ISSET(conn->log_flags, WT_CONN_LOG_ENABLED));	log = conn->log;	WT_TRET(__wt_readunlock(session, log->log_archive_lock));	WT_TRET(__curlog_reset(cursor));	__wt_free(session, cl->cur_lsn);	__wt_free(session, cl->next_lsn);	__wt_scr_free(session, &cl->logrec);	__wt_scr_free(session, &cl->opkey);	__wt_scr_free(session, &cl->opvalue);	__wt_free(session, cl->packed_key);	__wt_free(session, cl->packed_value);	WT_TRET(__wt_cursor_close(cursor));err:	API_END_RET(session, ret);}
开发者ID:brianleepzx,项目名称:mongo,代码行数:31,


示例7: __curbackup_close

/* * __curbackup_close -- *	WT_CURSOR->close method for the backup cursor type. */static int__curbackup_close(WT_CURSOR *cursor){	WT_CURSOR_BACKUP *cb;	WT_DECL_RET;	WT_SESSION_IMPL *session;	cb = (WT_CURSOR_BACKUP *)cursor;	CURSOR_API_CALL(cursor, session, close, NULL);	/*	 * When starting a hot backup, we serialize hot backup cursors and set	 * the connection's hot-backup flag. Once that's done, we set the	 * cursor's backup-locker flag, implying the cursor owns all necessary	 * cleanup (including removing temporary files), regardless of error or	 * success. The cursor's backup-locker flag is never cleared (it's just	 * discarded when the cursor is closed), because that cursor will never	 * not be responsible for cleanup.	 */	if (F_ISSET(cb, WT_CURBACKUP_LOCKER))		WT_TRET(__backup_stop(session, cb));	WT_TRET(__wt_cursor_close(cursor));	session->bkp_cursor = NULL;err:	API_END_RET(session, ret);}
开发者ID:DINKIN,项目名称:mongo,代码行数:32,


示例8: __curfile_close

/* * __curfile_close -- *	WT_CURSOR->close method for the btree cursor type. */static int__curfile_close(WT_CURSOR *cursor){	WT_CURSOR_BTREE *cbt;	WT_CURSOR_BULK *cbulk;	WT_DECL_RET;	WT_SESSION_IMPL *session;	cbt = (WT_CURSOR_BTREE *)cursor;	CURSOR_API_CALL(cursor, session, close, cbt->btree);	if (F_ISSET(cursor, WT_CURSTD_BULK)) {		/* Free the bulk-specific resources. */		cbulk = (WT_CURSOR_BULK *)cbt;		WT_TRET(__wt_bulk_wrapup(session, cbulk));		__wt_buf_free(session, &cbulk->last);	}	WT_TRET(__wt_btcur_close(cbt, 0));	/* The URI is owned by the btree handle. */	cursor->internal_uri = NULL;	WT_TRET(__wt_cursor_close(cursor));	/*	 * Note: release the data handle last so that cursor statistics are	 * updated correctly.	 */	if (session->dhandle != NULL) {		/* Increment the data-source's in-use counter. */		__wt_cursor_dhandle_decr_use(session);		WT_TRET(__wt_session_release_btree(session));	}err:	API_END_RET(session, ret);}
开发者ID:qihsh,项目名称:mongo,代码行数:38,


示例9: __curfile_equals

/* * __curfile_equals -- *	WT_CURSOR->equals method for the btree cursor type. */static int__curfile_equals(WT_CURSOR *a, WT_CURSOR *b, int *equalp){	WT_CURSOR_BTREE *cbt;	WT_DECL_RET;	WT_SESSION_IMPL *session;	cbt = (WT_CURSOR_BTREE *)a;	CURSOR_API_CALL(a, session, equals, cbt->btree);	/*	 * Check both cursors are a "file:" type then call the underlying	 * function, it can handle cursors pointing to different objects.	 */	if (!WT_PREFIX_MATCH(a->internal_uri, "file:") ||	    !WT_PREFIX_MATCH(b->internal_uri, "file:"))		WT_ERR_MSG(session, EINVAL,		    "Cursors must reference the same object");	WT_CURSOR_CHECKKEY(a);	WT_CURSOR_CHECKKEY(b);	ret = __wt_btcur_equals(	    (WT_CURSOR_BTREE *)a, (WT_CURSOR_BTREE *)b, equalp);err:	API_END_RET(session, ret);}
开发者ID:qihsh,项目名称:mongo,代码行数:31,


示例10: __curbulk_insert_fix_bitmap

/* * __curbulk_insert_fix_bitmap -- *	Fixed-length column-store bulk cursor insert for bitmaps. */static int__curbulk_insert_fix_bitmap(WT_CURSOR *cursor){	WT_BTREE *btree;	WT_CURSOR_BULK *cbulk;	WT_DECL_RET;	WT_SESSION_IMPL *session;	cbulk = (WT_CURSOR_BULK *)cursor;	btree = cbulk->cbt.btree;	/*	 * Bulk cursor inserts are updates, but don't need auto-commit	 * transactions because they are single-threaded and not visible	 * until the bulk cursor is closed.	 */	CURSOR_API_CALL(cursor, session, insert, btree);	WT_STAT_FAST_DATA_INCR(session, cursor_insert_bulk);	WT_CURSOR_CHECKVALUE(cursor);	/* Insert the current record. */	ret = __wt_bulk_insert_fix_bitmap(session, cbulk);err:	API_END_RET(session, ret);}
开发者ID:AshishSanju,项目名称:mongo,代码行数:30,


示例11: __clsm_compare

/* * __clsm_compare -- *	WT_CURSOR->compare implementation for the LSM cursor type. */static int__clsm_compare(WT_CURSOR *a, WT_CURSOR *b, int *cmpp){	WT_CURSOR_LSM *alsm;	WT_DECL_RET;	WT_SESSION_IMPL *session;	/* There's no need to sync with the LSM tree, avoid WT_LSM_ENTER. */	alsm = (WT_CURSOR_LSM *)a;	CURSOR_API_CALL(a, session, compare, NULL);	/*	 * Confirm both cursors refer to the same source and have keys, then	 * compare the keys.	 */	if (strcmp(a->uri, b->uri) != 0)		WT_ERR_MSG(session, EINVAL,		    "comparison method cursors must reference the same object");	WT_CURSOR_NEEDKEY(a);	WT_CURSOR_NEEDKEY(b);	WT_ERR(__wt_compare(	    session, alsm->lsm_tree->collator, &a->key, &b->key, cmpp));err:	API_END_RET(session, ret);}
开发者ID:nicopoliakov,项目名称:mongo,代码行数:31,


示例12: __curds_close

/* * __curds_close -- *	WT_CURSOR.close method for the data-source cursor type. */static int__curds_close(WT_CURSOR *cursor){	WT_CURSOR *source;	WT_DECL_RET;	WT_SESSION_IMPL *session;	source = ((WT_CURSOR_DATA_SOURCE *)cursor)->source;	CURSOR_API_CALL(cursor, session, close, NULL);	if (source != NULL)		ret = source->close(source);	/*	 * The key/value formats are in allocated memory, which isn't standard	 * behavior.	 */	__wt_free(session, cursor->key_format);	__wt_free(session, cursor->value_format);	WT_TRET(__wt_cursor_close(cursor));err:	API_END_RET(session, ret);}
开发者ID:EaseTech,项目名称:wiredtiger,代码行数:29,


示例13: __curjoin_get_value

/* * __curjoin_get_value -- *	WT_CURSOR->get_value for join cursors. */static int__curjoin_get_value(WT_CURSOR *cursor, ...){	WT_CURSOR_JOIN *cjoin;	WT_CURSOR_JOIN_ITER *iter;	WT_DECL_RET;	WT_SESSION_IMPL *session;	va_list ap;	cjoin = (WT_CURSOR_JOIN *)cursor;	iter = cjoin->iter;	va_start(ap, cursor);	CURSOR_API_CALL(cursor, session, get_value, NULL);	if (!F_ISSET(cjoin, WT_CURJOIN_INITIALIZED) ||	    !__curjoin_entry_iter_ready(iter))		WT_ERR_MSG(session, EINVAL,		    "join cursor must be advanced with next()");	if (iter->entry->index != NULL)		WT_ERR(__wt_curindex_get_valuev(iter->cursor, ap));	else		WT_ERR(__wt_curtable_get_valuev(iter->cursor, ap));err:	va_end(ap);	API_END_RET(session, ret);}
开发者ID:Zhangwusheng,项目名称:wiredtiger,代码行数:31,


示例14: __curmetadata_search

/* * __curmetadata_search -- *	WT_CURSOR->search method for the metadata cursor type. */static int__curmetadata_search(WT_CURSOR *cursor){	WT_CURSOR *file_cursor;	WT_CURSOR_METADATA *mdc;	WT_DECL_RET;	WT_SESSION_IMPL *session;	mdc = (WT_CURSOR_METADATA *)cursor;	file_cursor = mdc->file_cursor;	CURSOR_API_CALL(cursor, session,	    search, ((WT_CURSOR_BTREE *)file_cursor)->btree);	WT_MD_CURSOR_NEEDKEY(cursor);	if (WT_KEY_IS_METADATA(&cursor->key))		WT_ERR(__curmetadata_metadata_search(session, cursor));	else {		WT_WITH_TXN_ISOLATION(session, WT_ISO_READ_UNCOMMITTED,		    ret = file_cursor->search(file_cursor));		WT_ERR(ret);		WT_ERR(__curmetadata_setkv(mdc, file_cursor));	}err:	if (ret != 0) {		F_CLR(mdc, WT_MDC_POSITIONED | WT_MDC_ONMETADATA);		F_CLR(cursor, WT_CURSTD_KEY_EXT | WT_CURSTD_VALUE_EXT);	}	API_END_RET(session, ret);}
开发者ID:GYGit,项目名称:mongo,代码行数:34,


示例15: __curindex_search_near

/* * __curindex_search_near -- *	WT_CURSOR->search_near method for index cursors. */static int__curindex_search_near(WT_CURSOR *cursor, int *exact){	WT_CURSOR *child;	WT_CURSOR_INDEX *cindex;	WT_DECL_RET;	WT_ITEM found_key;	WT_SESSION_IMPL *session;	int cmp;	cindex = (WT_CURSOR_INDEX *)cursor;	child = cindex->child;	JOINABLE_CURSOR_API_CALL(cursor, session, search, NULL);	/*	 * We are searching using the application-specified key, which	 * (usually) doesn't contain the primary key, so it is just a prefix of	 * any matching index key.  That said, if there is an exact match, we	 * want to find the first matching index entry and set exact equal to	 * zero.	 *	 * Do a search_near, and if we find an entry that is too small, step to	 * the next one.  In the unlikely event of a search past the end of the	 * tree, go back to the last key.	 */	__wt_cursor_set_raw_key(child, &cursor->key);	WT_ERR(child->search_near(child, &cmp));	if (cmp < 0) {		if ((ret = child->next(child)) == WT_NOTFOUND)			ret = child->prev(child);		WT_ERR(ret);	}	/*	 * We expect partial matches, and want the smallest record with a key	 * greater than or equal to the search key.	 *	 * If the found key starts with the search key, we indicate a match by	 * setting exact equal to zero.	 *	 * The compare function expects application-supplied keys to come first	 * so we flip the sign of the result to match what callers expect.	 */	found_key = child->key;	if (found_key.size > cursor->key.size)		found_key.size = cursor->key.size;	WT_ERR(__wt_compare(	    session, cindex->index->collator, &cursor->key, &found_key, exact));	*exact = -*exact;	WT_ERR(__curindex_move(cindex));	if (0) {err:		F_CLR(cursor, WT_CURSTD_KEY_INT | WT_CURSTD_VALUE_INT);	}	API_END_RET(session, ret);}
开发者ID:ksuarz,项目名称:mongo,代码行数:64,


示例16: __curlog_search

/* * __curlog_search -- *	WT_CURSOR.search method for the log cursor type. */static int__curlog_search(WT_CURSOR *cursor){	WT_CURSOR_LOG *cl;	WT_DECL_RET;	WT_LSN key;	WT_SESSION_IMPL *session;	uint32_t counter;	cl = (WT_CURSOR_LOG *)cursor;	CURSOR_API_CALL(cursor, session, search, NULL);	/*	 * !!! We are ignoring the counter and only searching based on the LSN.	 */	WT_ERR(__wt_cursor_get_key((WT_CURSOR *)cl,	    &key.file, &key.offset, &counter));	WT_ERR(__wt_log_scan(session, &key, WT_LOGSCAN_ONE,	    __curlog_logrec, cl));	WT_ERR(__curlog_kv(session, cursor));	WT_STAT_FAST_CONN_INCR(session, cursor_search);	WT_STAT_FAST_DATA_INCR(session, cursor_search);err:	API_END_RET(session, ret);}
开发者ID:EaseTech,项目名称:wiredtiger,代码行数:30,


示例17: __curmetadata_next

/* * __curmetadata_next -- *	WT_CURSOR->next method for the metadata cursor type. */static int__curmetadata_next(WT_CURSOR *cursor){	WT_CURSOR *file_cursor;	WT_CURSOR_METADATA *mdc;	WT_DECL_RET;	WT_SESSION_IMPL *session;	mdc = (WT_CURSOR_METADATA *)cursor;	file_cursor = mdc->file_cursor;	CURSOR_API_CALL(cursor, session,	    next, ((WT_CURSOR_BTREE *)file_cursor)->btree);	if (!F_ISSET(mdc, WT_MDC_POSITIONED))		WT_ERR(__curmetadata_metadata_search(session, cursor));	else {		WT_ERR(file_cursor->next(mdc->file_cursor));		WT_MD_SET_KEY_VALUE(cursor, mdc, file_cursor);	}err:	if (ret != 0) {		F_CLR(mdc, WT_MDC_POSITIONED | WT_MDC_ONMETADATA);		F_CLR(cursor, WT_CURSTD_KEY_EXT | WT_CURSTD_VALUE_EXT);	}	API_END_RET(session, ret);}
开发者ID:EaseTech,项目名称:wiredtiger,代码行数:30,


示例18: __curlog_next

/* * __curlog_next -- *	WT_CURSOR.next method for the step log cursor type. */static int__curlog_next(WT_CURSOR *cursor){	WT_CURSOR_LOG *cl;	WT_DECL_RET;	WT_SESSION_IMPL *session;	cl = (WT_CURSOR_LOG *)cursor;	CURSOR_API_CALL(cursor, session, next, NULL);	/*	 * If we don't have a record, or went to the end of the record we	 * have, or we are in the zero-fill portion of the record, get a	 * new one.	 */	if (cl->stepp == NULL || cl->stepp >= cl->stepp_end || !*cl->stepp) {		cl->txnid = 0;		WT_ERR(__wt_log_scan(session, cl->next_lsn, WT_LOGSCAN_ONE,		    __curlog_logrec, cl));	}	WT_ASSERT(session, cl->logrec->data != NULL);	WT_ERR(__curlog_kv(session, cursor));	WT_STAT_FAST_CONN_INCR(session, cursor_next);	WT_STAT_FAST_DATA_INCR(session, cursor_next);err:	API_END_RET(session, ret);}
开发者ID:EaseTech,项目名称:wiredtiger,代码行数:33,


示例19: __curmetadata_next

/* * __curmetadata_next -- *	WT_CURSOR->next method for the metadata cursor type. */static int__curmetadata_next(WT_CURSOR *cursor){	WT_CURSOR *file_cursor;	WT_CURSOR_METADATA *mdc;	WT_DECL_RET;	WT_SESSION_IMPL *session;	mdc = (WT_CURSOR_METADATA *)cursor;	file_cursor = mdc->file_cursor;	CURSOR_API_CALL(cursor, session,	    next, ((WT_CURSOR_BTREE *)file_cursor)->btree);	if (!F_ISSET(mdc, WT_MDC_POSITIONED))		WT_ERR(__curmetadata_metadata_search(session, cursor));	else {		/*		 * When applications open metadata cursors, they expect to see		 * all schema-level operations reflected in the results.  Query		 * at read-uncommitted to avoid confusion caused by the current		 * transaction state.		 */		WT_WITH_TXN_ISOLATION(session, WT_ISO_READ_UNCOMMITTED,		    ret = file_cursor->next(mdc->file_cursor));		WT_ERR(ret);		WT_ERR(__curmetadata_setkv(mdc, file_cursor));	}err:	if (ret != 0) {		F_CLR(mdc, WT_MDC_POSITIONED | WT_MDC_ONMETADATA);		F_CLR(cursor, WT_CURSTD_KEY_EXT | WT_CURSTD_VALUE_EXT);	}	API_END_RET(session, ret);}
开发者ID:GYGit,项目名称:mongo,代码行数:38,


示例20: __curindex_search

/* * __curindex_search -- *	WT_CURSOR->search method for index cursors. */static int__curindex_search(WT_CURSOR *cursor){	WT_CURSOR *child;	WT_CURSOR_INDEX *cindex;	WT_DECL_RET;	WT_ITEM found_key;	WT_SESSION_IMPL *session;	int cmp;	cindex = (WT_CURSOR_INDEX *)cursor;	child = cindex->child;	JOINABLE_CURSOR_API_CALL(cursor, session, search, NULL);	/*	 * We are searching using the application-specified key, which	 * (usually) doesn't contain the primary key, so it is just a prefix of	 * any matching index key.  Do a search_near, step to the next entry if	 * we land on one that is too small, then check that the prefix	 * matches.	 */	__wt_cursor_set_raw_key(child, &cursor->key);	WT_ERR(child->search_near(child, &cmp));	if (cmp < 0)		WT_ERR(child->next(child));	/*	 * We expect partial matches, and want the smallest record with a key	 * greater than or equal to the search key.	 *	 * If the key we find is shorter than the search key, it can't possibly	 * match.	 *	 * The only way for the key to be exactly equal is if there is an index	 * on the primary key, because otherwise the primary key columns will	 * be appended to the index key, but we don't disallow that (odd) case.	 */	found_key = child->key;	if (found_key.size < cursor->key.size)		WT_ERR(WT_NOTFOUND);	found_key.size = cursor->key.size;	WT_ERR(__wt_compare(	    session, cindex->index->collator, &cursor->key, &found_key, &cmp));	if (cmp != 0) {		ret = WT_NOTFOUND;		goto err;	}	WT_ERR(__curindex_move(cindex));	if (0) {err:		F_CLR(cursor, WT_CURSTD_KEY_INT | WT_CURSTD_VALUE_INT);	}	API_END_RET(session, ret);}
开发者ID:ksuarz,项目名称:mongo,代码行数:62,


示例21: __curjoin_close

/* * __curjoin_close -- *	WT_CURSOR::close for join cursors. */static int__curjoin_close(WT_CURSOR *cursor){	WT_CURSOR_JOIN *cjoin;	WT_CURSOR_JOIN_ENDPOINT *end;	WT_CURSOR_JOIN_ENTRY *entry;	WT_DECL_RET;	WT_SESSION_IMPL *session;	u_int i;	cjoin = (WT_CURSOR_JOIN *)cursor;	JOINABLE_CURSOR_API_CALL_PREPARE_ALLOWED(cursor, session, close, NULL);err:	WT_TRET(__wt_schema_release_table(session, &cjoin->table));	/* This is owned by the table */	cursor->key_format = NULL;	if (cjoin->projection != NULL) {		__wt_free(session, cjoin->projection);		__wt_free(session, cursor->value_format);	}	for (entry = cjoin->entries, i = 0; i < cjoin->entries_next;		entry++, i++) {		if (entry->subjoin != NULL) {			F_CLR(&entry->subjoin->iface, WT_CURSTD_JOINED);			entry->subjoin->parent = NULL;		}		if (entry->main != NULL)			WT_TRET(entry->main->close(entry->main));		if (F_ISSET(entry, WT_CURJOIN_ENTRY_OWN_BLOOM))			WT_TRET(__wt_bloom_close(entry->bloom));		for (end = &entry->ends[0];		     end < &entry->ends[entry->ends_next]; end++) {			F_CLR(end->cursor, WT_CURSTD_JOINED);			if (F_ISSET(end, WT_CURJOIN_END_OWN_CURSOR))				WT_TRET(end->cursor->close(end->cursor));		}		__wt_free(session, entry->ends);		__wt_free(session, entry->repack_format);	}	if (cjoin->iter != NULL)		WT_TRET(__curjoin_iter_close_all(cjoin->iter));	if (cjoin->main != NULL)		WT_TRET(cjoin->main->close(cjoin->main));	__wt_free(session, cjoin->entries);	__wt_cursor_close(cursor);	API_END_RET(session, ret);}
开发者ID:mongodb,项目名称:mongo,代码行数:57,


示例22: __async_search

/* * __async_search -- *	WT_ASYNC_OP->search implementation for op handles. */static int__async_search(WT_ASYNC_OP *asyncop){	WT_ASYNC_OP_IMPL *op;	WT_DECL_RET;	WT_SESSION_IMPL *session;	op = (WT_ASYNC_OP_IMPL *)asyncop;	ASYNCOP_API_CALL(O2C(op), session, search);	WT_STAT_CONN_INCR(O2S(op), async_op_search);	WT_ERR(__async_op_wrap(op, WT_AOP_SEARCH));err:	API_END_RET(session, ret);}
开发者ID:ksuarz,项目名称:mongo,代码行数:17,


示例23: __async_compact

/* * __async_compact -- *	WT_ASYNC_OP->compact implementation for op handles. */static int__async_compact(WT_ASYNC_OP *asyncop){	WT_ASYNC_OP_IMPL *op;	WT_DECL_RET;	WT_SESSION_IMPL *session;	op = (WT_ASYNC_OP_IMPL *)asyncop;	ASYNCOP_API_CALL(O2C(op), session, compact);	WT_STAT_FAST_CONN_INCR(O2S(op), async_op_compact);	WT_ERR(__async_op_wrap(op, WT_AOP_COMPACT));err:	API_END_RET(session, ret);}
开发者ID:3rf,项目名称:mongo,代码行数:17,


示例24: __curbackup_reset

/* * __curbackup_reset -- *	WT_CURSOR->reset method for the backup cursor type. */static int__curbackup_reset(WT_CURSOR *cursor){	WT_CURSOR_BACKUP *cb;	WT_DECL_RET;	WT_SESSION_IMPL *session;	cb = (WT_CURSOR_BACKUP *)cursor;	CURSOR_API_CALL(cursor, session, reset, NULL);	cb->next = 0;	F_CLR(cursor, WT_CURSTD_KEY_SET | WT_CURSTD_VALUE_SET);err:	API_END_RET(session, ret);}
开发者ID:mdkhaled,项目名称:mongo,代码行数:19,


示例25: __curjoin_reset

/* * __curjoin_reset -- *	WT_CURSOR::reset for join cursors. */static int__curjoin_reset(WT_CURSOR *cursor){	WT_CURSOR_JOIN *cjoin;	WT_DECL_RET;	WT_SESSION_IMPL *session;	cjoin = (WT_CURSOR_JOIN *)cursor;	JOINABLE_CURSOR_API_CALL_PREPARE_ALLOWED(cursor, session, reset, NULL);	if (cjoin->iter != NULL)		WT_ERR(__curjoin_iter_reset(cjoin->iter));err:	API_END_RET(session, ret);}
开发者ID:mongodb,项目名称:mongo,代码行数:20,


示例26: __curfile_reset

/* * __curfile_reset -- *	WT_CURSOR->reset method for the btree cursor type. */static int__curfile_reset(WT_CURSOR *cursor){	WT_CURSOR_BTREE *cbt;	WT_DECL_RET;	WT_SESSION_IMPL *session;	cbt = (WT_CURSOR_BTREE *)cursor;	CURSOR_API_CALL(cursor, session, reset, cbt->btree);	ret = __wt_btcur_reset(cbt);	F_CLR(cursor, WT_CURSTD_KEY_SET | WT_CURSTD_VALUE_SET);err:	API_END_RET(session, ret);}
开发者ID:qihsh,项目名称:mongo,代码行数:20,


示例27: __curfile_prev

/* * __curfile_prev -- *	WT_CURSOR->prev method for the btree cursor type. */static int__curfile_prev(WT_CURSOR *cursor){	WT_CURSOR_BTREE *cbt;	WT_DECL_RET;	WT_SESSION_IMPL *session;	cbt = (WT_CURSOR_BTREE *)cursor;	CURSOR_API_CALL(cursor, session, prev, cbt->btree);	F_CLR(cursor, WT_CURSTD_KEY_SET | WT_CURSTD_VALUE_SET);	if ((ret = __wt_btcur_prev(cbt, 0)) == 0)		F_SET(cursor, WT_CURSTD_KEY_INT | WT_CURSTD_VALUE_INT);err:	API_END_RET(session, ret);}
开发者ID:qihsh,项目名称:mongo,代码行数:20,



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


C++ API_ERRNO_TO_API_ERRNUM函数代码示例
C++ APIFunctionError函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。