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


C++ KDirectoryRelease函数代码示例

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


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

示例1: KDyldVAddSearchPath

/* AddSearchPath
 *  add a search path to loader for locating library files
 */
LIB_EXPORT rc_t CC KDyldVAddSearchPath ( KDyld *self, const char *path, va_list args )
{
    rc_t rc;
    if ( self == NULL )
        rc = RC ( rcFS, rcDylib, rcUpdating, rcSelf, rcNull );
    else
    {
        KDirectory *wd;
        rc = KDirectoryNativeDir ( & wd );
        if ( rc == 0 )
        {
            const KDirectory *dir;
            rc = KDirectoryVOpenDirRead ( wd, & dir, false, path, args );
            if ( rc == 0 )
            {
                rc = VectorAppend ( & self -> search, NULL, dir );
                if ( rc != 0 )
                    KDirectoryRelease ( dir );
            }

            KDirectoryRelease ( wd );
        }
    }
    return rc;
}
开发者ID:gconcepcion,项目名称:sratoolkit,代码行数:28,代码来源:sysdll.c

示例2: KDBOpenPathTypeReadInt

static rc_t KDBOpenPathTypeReadInt ( const KDBManager * mgr, const KDirectory * dir, const char * path,
                                     const KDirectory ** pdir, int * type,
                                     int pathtype, uint32_t rcobj, bool try_srapath )
{
    VFSManager * vmgr = mgr->vfsmgr;
    const KDirectory * ldir = NULL;
    rc_t rc = 0;

    /* object relative opens can be done using KFS - we hacked in VFS after all */
    if (! try_srapath)
    {
        rc = KDirectoryOpenDirUpdate ((KDirectory*)dir, (KDirectory**)pdir, false, path);
        if ((rc) && (GetRCState(rc) != rcNotFound))
            rc = KDirectoryOpenDirRead (dir, pdir, false, path);
    }
    else
    {
        VPath * vpath;

        /*
         * We've got to decide if the path coming in is a full or relative
         * path and if relative make it relative to dir or possibly its a srapath
         * accession
         *
         */
        rc = VPathMakeDirectoryRelative ( &vpath, dir, path );
        if ( rc == 0 )
        {
            rc = VFSManagerOpenDirectoryReadDirectoryRelativeDecrypt ( vmgr, dir, &ldir, vpath );

            if ( rc == 0 )
            {
                *type = (~kptAlias) & KDBPathType ( ldir, NULL, "." );

                /* just a directory, not a kdb type */
                if ( *type == kptDir )
                    rc = RC (rcDB, rcMgr, rcOpening, rcPath, rcIncorrect);

                else if ( *type != pathtype )
                {
                    KDirectoryRelease( ldir );
                    rc = RC ( rcDB, rcMgr, rcOpening, rcobj, rcIncorrect );
                }
                else
                {
                    if ( pdir != NULL )
                        *pdir = ldir;
                    else
                        KDirectoryRelease( ldir );
                }
            }
            VPathRelease ( vpath );
        }
    }
    return rc;
}
开发者ID:gconcepcion,项目名称:sratoolkit,代码行数:56,代码来源:kdb.c

示例3: CCSraWhack

static
void CCSraWhack (CCSra * self)
{
    rc_t rc, orc;
    rc = KDirectoryRelease (self->ndir);
    orc = KDirectoryRelease (self->adir);
    if (rc == 0)
        rc = orc;
    orc = KFileRelease (self->file);
    if (rc == 0)
        rc = orc;
    if (rc)
        LOGERR(klogWarn, rc, "error releaseing CCSra");
    free (self);
}
开发者ID:ncbi,项目名称:sra-tools,代码行数:15,代码来源:ccsra.c

示例4: txt2kdb_release

void txt2kdb_release (void)
{
    KDirectoryRelease (G.dir);
    KFileRelease (G.txt);
    KDBManagerRelease (G.mgr);
    KColumnRelease (G.col);
}
开发者ID:DCGenomics,项目名称:sra-tools,代码行数:7,代码来源:txt2kdb.c

示例5: KTableWhack

/* Whack
 */
static
rc_t KTableWhack ( KTable *self )
{
    rc_t rc = 0;

    KRefcountWhack ( & self -> refcount, "KTable" );

    if ( self -> db != NULL )
    {
        rc = KDatabaseSever ( self -> db );
        if ( rc == 0 )
            self -> db = NULL;
    }

    if ( rc == 0 )
        rc = KDBManagerSever ( self -> mgr );

    if ( rc == 0 )
    {
        KDirectoryRelease ( self -> dir );
        free ( self );
        return 0;
    }

    KRefcountInit ( & self -> refcount, 1, "KTable", "whack", "ktbl" );

    return rc;
}
开发者ID:ImAWolf,项目名称:ncbi-vdb,代码行数:30,代码来源:table.c

示例6: make_rna_splice_log

struct rna_splice_log * make_rna_splice_log( const char * filename, const char * toolname )
{
    struct rna_splice_log * res = NULL;
    KDirectory * dir;
    rc_t rc = KDirectoryNativeDir ( &dir );
    if ( rc == 0 )
    {
        KFile * f;
        rc = KDirectoryCreateFile ( dir, &f, false, 0664, kcmInit, "%s", filename );
        if ( rc == 0 )
        {
            res = calloc( 1, sizeof * res );
            if ( res != NULL )
            {
                res->log_file = f;
                if ( toolname != NULL )
                    res->tool_name = string_dup_measure ( toolname, NULL );
            }
            else
                KFileRelease ( f );
        }
        KDirectoryRelease ( dir );
    }
    return res;
}
开发者ID:ncbi,项目名称:sra-tools,代码行数:25,代码来源:rna_splice_log.c

示例7: KDBVGetPathModDate

/* GetPathModDate
 *  extract mod date from a path
 */
rc_t KDBVGetPathModDate ( const KDirectory *dir,
    KTime_t *mtime, const char *path, va_list args )
{
    rc_t rc;
    uint32_t ptype;
    const KDirectory *obj_dir;

    va_list cpy;
    va_copy ( cpy, args );
    ptype = KDirectoryVPathType ( dir, path, cpy );
    va_end ( cpy );

    switch ( ptype )
    {
    case kptDir:
    case kptDir | kptAlias:
        break;

    default:
        return KDirectoryVDate ( dir, mtime, path, args );
    }

    * mtime = 0;
    rc = KDirectoryVOpenDirRead ( dir, & obj_dir, true, path, args );
    if ( rc == 0 )
    {
        rc = KDBGetObjModDate ( obj_dir, mtime );
        KDirectoryRelease ( obj_dir );
    }

    return rc;
}
开发者ID:gconcepcion,项目名称:sratoolkit,代码行数:35,代码来源:kdb.c

示例8: WriteNamelistToFileByName

LIB_EXPORT rc_t CC WriteNamelistToFileByName( const VNamelist * namelist, const char * filename,
        const char * delim )
{
    rc_t rc;
    if ( namelist == NULL || filename == NULL || delim == NULL )
        rc = RC( rcFS, rcFile, rcValidating, rcParam, rcNull );
    else
    {
        KDirectory * dir;
        rc = KDirectoryNativeDir ( &dir );
        if ( rc == 0 )
        {
            KFile * f;
            rc = KDirectoryCreateFile ( dir, &f, true, 0664, kcmCreate, filename );
            if ( rc == 0 )
            {
                if ( rc == 0 )
                    rc = SaveToFile( f, namelist, delim );
                KFileRelease ( f );
            }
            KDirectoryRelease ( dir );
        }
    }
    return rc;
}
开发者ID:gconcepcion,项目名称:sratoolkit,代码行数:25,代码来源:from_to_namelist.c

示例9: LoadFileByNameToNameList

LIB_EXPORT rc_t CC LoadFileByNameToNameList( VNamelist * namelist, const char * filename )
{
    rc_t rc;
    if ( namelist == NULL || filename == NULL )
        rc = RC( rcFS, rcFile, rcValidating, rcParam, rcNull );
    else
    {
        KDirectory * dir;
        rc = KDirectoryNativeDir ( &dir );
        if ( rc == 0 )
        {
            KFile const * f;
            rc = KDirectoryOpenFileRead ( dir, &f, "%s", filename );
            if ( rc == 0 )
            {
                if ( rc == 0 )
                    rc = LoadFromFile( f, namelist );
                KFileRelease ( f );
            }
            KDirectoryRelease ( dir );
        }
    }
    return rc;

}
开发者ID:gconcepcion,项目名称:sratoolkit,代码行数:25,代码来源:from_to_namelist.c

示例10: cg_dump_src_dst_rows_cur

static rc_t cg_dump_src_dst_rows_cur( cg_dump_opts * opts, cg_dump_ctx * cg_ctx )
{
    /* preparations */
    rc_t rc = cg_dump_prepare_seq_tab( cg_ctx );
/*
    if ( rc == 0 )
        rc = cg_dump_prepare_prim_tab( cg_ctx );
*/
    if ( rc == 0 )
        rc = cg_dump_adjust_rowrange( cg_ctx );
    if ( rc == 0 )
        rc = cg_dump_setup_progressbar( cg_ctx );
    if ( rc == 0 )
        rc = cg_dump_prepare_output( opts, cg_ctx );

    /* loop through the SEQUENCE-table */
    if ( rc == 0 )
    {
        rc = cg_dump_loop( opts, cg_ctx ); /* <================== */

        if ( cg_ctx->progress != NULL )
            destroy_progressbar( cg_ctx->progress );
        BSTreeWhack ( &cg_ctx->lanes, whack_lanes_nodes, NULL );
        KDirectoryRelease( cg_ctx->out_dir );
    }
    return rc;
}
开发者ID:DCGenomics,项目名称:sra-tools,代码行数:27,代码来源:cg-dump.c

示例11: CCSraInit

static
rc_t CCSraInit (CCSra ** pself, CCTree * tree, const KFile * sf, const char * name)
{
    CCSra * self;
    rc_t rc;

    assert (pself);
    assert (sf);
    assert (name);

    self = malloc (sizeof (*self));
    if (self == NULL)
        rc = RC (rcExe, rcMemory, rcAllocating, rcMemory, rcExhausted);
    else
    {
        KFileAddRef (self->file = sf);

        rc = KDirectoryMakeSraNodeDir (&self->ndir, sf, name);
        if (rc == 0)
        {
            rc = KDirectoryOpenSraArchiveReadUnbounded (self->ndir, &self->adir, true, "%s", name);
            if (rc == 0)
            {
                self->tree = tree;
                *pself = self;
                return 0;
            }
            KDirectoryRelease (self->ndir);
        }
        free (self);
    }
    return rc; /* error out */
}
开发者ID:ncbi,项目名称:sra-tools,代码行数:33,代码来源:ccsra.c

示例12: KDBManagerVOpenColumnReadInt

/* OpenColumnRead
 * VOpenColumnRead
 *  open a column for read
 *
 *  "col" [ OUT ] - return parameter for newly opened column
 *
 *  "path" [ IN ] - NUL terminated string in UTF-8 giving path to col
 *  where "." acts as a structure name separator, i.e. struct.member
 */
static
rc_t KDBManagerVOpenColumnReadInt ( const KDBManager *self,
    const KColumn **colp, const KDirectory *wd, bool try_srapath,
    const char *path, va_list args )
{
    char colpath [ 4096 ];
    rc_t rc;
    size_t z;

/*    rc = KDirectoryVResolvePath ( wd, 1,
        colpath, sizeof colpath, path, args ); */
    rc = string_vprintf( colpath, sizeof colpath, &z, path, args );
    if ( rc == 0 )
    {
        KColumn *col;
        const KDirectory *dir;

        /* open table directory */
        rc = KDBOpenPathTypeRead ( self, wd, colpath, &dir, kptColumn, NULL, try_srapath );
        if ( rc == 0 )
        {
            rc = KColumnMakeRead ( & col, dir, colpath );
            if ( rc == 0 )
            {
                col -> mgr = KDBManagerAttach ( self );
                * colp = col;
                return 0;
            }

            KDirectoryRelease ( dir );
        }
    }
    
    return rc;
}
开发者ID:binlu1981,项目名称:ncbi-vdb,代码行数:44,代码来源:column.c

示例13: KDBManagerVOpenDBReadInt

/* OpenDBRead
 * VOpenDBRead
 *  open a database for read
 *
 *  "db" [ OUT ] - return parameter for newly opened database
 *
 *  "path" [ IN ] - NUL terminated string in
 *  wd-native character set giving path to database
 */
static
rc_t KDBManagerVOpenDBReadInt ( const KDBManager *self,
    const KDatabase **dbp, const KDirectory *wd,
    const char *path, va_list args )
{
    /* generate absolute path to db */
    char dbpath [ 4096 ];
    rc_t rc = KDirectoryVResolvePath ( wd, true,
        dbpath, sizeof dbpath, path, args );
    if ( rc == 0 )
    {
        KDatabase *db;
        const KDirectory *dir;

        /* open the directory if its a database */
        rc = KDBOpenPathTypeRead ( wd, dbpath, &dir, kptDatabase, NULL );
        if ( rc == 0 )
        {
            /* allocate a new guy */
            rc = KDatabaseMake ( & db, dir, dbpath );
            if ( rc == 0 )
            {
                db -> mgr = KDBManagerAttach ( self );
                * dbp = db;
                return 0;
            }

            KDirectoryRelease ( dir );
        }
    }
    
    return rc;
}
开发者ID:gconcepcion,项目名称:sratoolkit,代码行数:42,代码来源:database-cmn.c

示例14: SpotIteratorDestroy

static rc_t SpotIteratorDestroy(struct SpotIterator* self)
{
    assert(self);
    KDirectoryRelease(__SpotIteratorDirectory);
    __SpotIteratorDirectory = NULL;
    return KFileRelease(self->m_file);
}
开发者ID:Bhumi28,项目名称:sra-tools,代码行数:7,代码来源:rd-filter-redact.c

示例15: KDBManagerMakeDBUpdate

static
rc_t KDBManagerMakeDBUpdate ( KDBManager *self,
    KDatabase **dbp, KDirectory *wd, const char *path, KMD5SumFmt *md5 )
{
    rc_t rc;
    KDirectory *dir;

    rc = KDirectoryOpenDirUpdate ( wd, & dir, false, "%s", path );
    if ( rc == 0 )
    {
        KDatabase *db;
	    
        /* Make the base object */
        rc = KDatabaseMake ( & db, dir, path, md5, false );
        if ( rc == 0 )
        {
            rc = KDBManagerInsertDatabase ( self, db );

            if ( rc == 0 )
            {
                * dbp = db;
                return 0;   /* successful exit */
            }

            rc = RC ( rcDB, rcMgr, rcOpening, rcDatabase, rcBusy );
                
            free ( db );
        }
        KDirectoryRelease ( dir );
    }
    return rc;
}
开发者ID:ImAWolf,项目名称:ncbi-vdb,代码行数:32,代码来源:wdatabase.c


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