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


C++ DB_ENV::remove方法代码示例

本文整理汇总了C++中DB_ENV::remove方法的典型用法代码示例。如果您正苦于以下问题:C++ DB_ENV::remove方法的具体用法?C++ DB_ENV::remove怎么用?C++ DB_ENV::remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DB_ENV的用法示例。


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

示例1: db_fini

static int db_fini(dbiIndex dbi, const char * dbhome,
		const char * dbfile,
		const char * dbsubfile)
{
    rpmdb rpmdb = dbi->dbi_rpmdb;
    DB_ENV * dbenv = rpmdb->db_dbenv;
    int rc;

    if (dbenv == NULL)
	return 0;

    rc = dbenv->close(dbenv, 0);
    rc = cvtdberr(dbi, "dbenv->close", rc, _debug);

    if (dbfile)
	rpmlog(RPMLOG_DEBUG, "closed   db environment %s/%s\n",
			dbhome, dbfile);

    if (rpmdb->db_remove_env) {
	int xx;

	xx = db_env_create(&dbenv, 0);
	xx = cvtdberr(dbi, "db_env_create", xx, _debug);
	xx = dbenv->remove(dbenv, dbhome, 0);
	xx = cvtdberr(dbi, "dbenv->remove", xx, _debug);

	if (dbfile)
	    rpmlog(RPMLOG_DEBUG, "removed  db environment %s/%s\n",
			dbhome, dbfile);

    }
    return rc;
}
开发者ID:xrg,项目名称:RPM,代码行数:33,代码来源:db3.c

示例2: remove

int DbEnv::remove(const char *db_home, u_int32_t flags)
{
	int ret;
	DB_ENV *env = unwrap(this);

	// after a remove (no matter if success or failure),
	// the underlying DB_ENV object must not be accessed,
	// so we clean up in advance.
	//
	cleanup();

	if ((ret = env->remove(env, db_home, flags)) != 0)
		DB_ERROR(this, "DbEnv::remove", ret, error_policy());

	return (ret);
}
开发者ID:SergeStinckwich,项目名称:openqwaq,代码行数:16,代码来源:cxx_env.cpp

示例3: remove_dbenv

int remove_dbenv(char *home)
{
    DB_ENV *dbenv;
    int ret;

    if ((ret = db_env_create(&dbenv, 0)) != 0) { 
	ci_debug_printf(1, " %s\n", db_strerror(ret)); 
	return 0; 
    } 
    if(dbenv->remove(dbenv, home, 0)!=0){
	ci_debug_printf(1, "Error removing environment....\n");
	return 0;
    }
    else
	ci_debug_printf(5, "OK removing environment\n");
    return 1;
}
开发者ID:p1rate5s,项目名称:c-icap,代码行数:17,代码来源:sguardDB.c

示例4: assert

/*
 * Forcebly removes the database environment.
 *
 * ARGUMENTS:
 *      path            Pathname of the database directory.  Shall not be NULL.
 *                      The client can free it upon return.
 * RETURNS:
 *      0               Success.
 *      ENOMEM          System error.  "log_start()" called.
 *      EIO             Backend database error.  "log_start()" called.
 */
static RegStatus
removeEnvironment(
    const char* const   path)
{
    RegStatus   status;
    DB_ENV*     env;

    assert(NULL != path);

    if (0 == (status = createEnvHandle(path, &env))) {
        if (status = env->remove(env, path, DB_FORCE)) {
            log_add("Couldn't remove environment for database \"%s\"", path);
            status = EIO;
        }
    }                                   /* "env" allocated */

    return status;
}
开发者ID:snowlionsun,项目名称:LDM,代码行数:29,代码来源:backend-bdb.c

示例5: db_fini

static int db_fini(rpmdb rdb, const char * dbhome)
{
    DB_ENV * dbenv = rdb->db_dbenv;
    int rc;
    int lockfd = -1;
    uint32_t eflags = 0;

    if (dbenv == NULL)
	return 0;

    if (rdb->db_opens > 1) {
	rdb->db_opens--;
	return 0;
    }

    (void) dbenv->get_open_flags(dbenv, &eflags);
    if (!(eflags & DB_PRIVATE))
	lockfd = serialize_env(dbhome);

    rc = dbenv->close(dbenv, 0);
    rc = dbapi_err(rdb, "dbenv->close", rc, _debug);

    rpmlog(RPMLOG_DEBUG, "closed   db environment %s\n", dbhome);

    if (!(eflags & DB_PRIVATE) && rdb->db_remove_env) {
	int xx;

	xx = db_env_create(&dbenv, 0);
	xx = dbapi_err(rdb, "db_env_create", xx, _debug);
	xx = dbenv->remove(dbenv, dbhome, 0);
	/* filter out EBUSY as it just means somebody else gets to clean it */
	xx = dbapi_err(rdb, "dbenv->remove", xx, (xx == EBUSY ? 0 : _debug));

	rpmlog(RPMLOG_DEBUG, "removed  db environment %s\n", dbhome);

    }

    if (lockfd >= 0)
	close(lockfd);

    return rc;
}
开发者ID:crossbuild,项目名称:rpm,代码行数:42,代码来源:db3.c

示例6:

static int
databaseEnvRemove(const char* dbenvpath,
                  int         flags)
{
#ifdef TRACE_FUNC_CALLS
    LOG_TRACE_IN;
#endif

    DB_ENV* localDbEnvHandle;
    int     ret;

    // Removing the database file
    db_env_create(&localDbEnvHandle, 0);

    ret = localDbEnvHandle->remove(localDbEnvHandle,
                                   dbenvpath,
                                   flags);
#ifdef TRACE_FUNC_CALLS
    LOG_TRACE_OUT;
#endif
    return ret;
}
开发者ID:btiwaree,项目名称:mws,代码行数:22,代码来源:PageDbHandle.cpp

示例7: clearDbEnv

void RepNode::clearDbEnv()
{
	// Clear the existing environment. Transaction is needless in this part.
	if (access(envHome_.c_str(), 0) < 0) {
		mkdir(envHome_.c_str(), 0755);
	} else {
		// Remove Container
		{
			DB_ENV* dbenv;
			createDbEnv(&dbenv, 0);
			dbenv->open(dbenv, envHome_.c_str(), envFlags_, 0);

			XmlManager mgr(dbenv, DBXML_ADOPT_DBENV);
			try {
				mgr.removeContainer(containerName_);
			} catch (...) {}
		}

		// Remove Environment
		DB_ENV* dbEnvRemove;
		createDbEnv(&dbEnvRemove, 0);
		dbEnvRemove->remove(dbEnvRemove, envHome_.c_str(), DB_FORCE);
	}
}
开发者ID:kanbang,项目名称:Colt,代码行数:24,代码来源:RepNode.cpp


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