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

C++ GetRCState函数代码示例

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

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



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

示例1: RefNameMake

static
rc_t RefNameMake ( RefName **objp, const VTable *tbl, const VCursor *native_curs )
{
    rc_t rc;

    /* create the object */
    RefName *obj = malloc ( sizeof * obj );
    if ( obj == NULL ) {
        rc = RC ( rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted );
    } else {
	obj->curs=NULL;
        /* open the reference cursor */
	rc = AlignRefTableCursor(tbl, native_curs, &obj->curs, NULL);
	if(rc == 0){
                /* add columns to cursor */
		rc = VCursorAddColumn(obj->curs, &obj->name_idx, "(utf8)REF_NAME");
		if( GetRCObject(rc) == rcColumn && GetRCState(rc) == rcNotFound ) {
			rc = VCursorAddColumn(obj->curs, &obj->name_idx, "(utf8)NAME");
		}
		if(GetRCState(rc) == rcExists){
			rc = 0;
		}
                if( rc == 0 ) {
                    *objp = obj;
                    return 0;
                }
                VCursorRelease ( obj -> curs );
        }
        free ( obj );
    }
    return rc;
}
开发者ID:gconcepcion,项目名称:sratoolkit,代码行数:32,代码来源:align-ref-name.c


示例2: calloc

static char *translate_accession( SRAPath *my_sra_path,
                           const char *accession,
                           const size_t bufsize )
{
    rc_t rc;
    char * res = calloc( 1, bufsize );
    if ( res == NULL ) return NULL;

    rc = SRAPathFind( my_sra_path, accession, res, bufsize );
    if ( GetRCState( rc ) == rcNotFound )
    {
        free( res );
        return NULL;
    }
    else if ( GetRCState( rc ) == rcInsufficient )
    {
        free( res );
        return translate_accession( my_sra_path, accession, bufsize * 2 );
    }
    else if ( rc != 0 )
    {
        free( res );
        return NULL;
    }
    return res;
}
开发者ID:gconcepcion,项目名称:sratoolkit,代码行数:26,代码来源:cmdline_cmn.c


示例3: KCipherMakeInt

rc_t KCipherMakeInt (KCipher ** new_cipher, kcipher_type type)
{
    rc_t rc;

    *new_cipher = NULL;

#if 0
    rc = KCipherVecAesNiMake (new_cipher, type);
    if (rc)
    {
        if (GetRCState(rc) == rcUnsupported)
        {
#if USE_SLOW_ONES
            rc = KCipherVecRegMake (new_cipher, type);
            if (rc)
            {
                if (GetRCState(rc) == rcUnsupported)
                {
                    rc = KCipherVecMake (new_cipher, type);
                    if (GetRCState(rc) == rcUnsupported)
                    {
#endif
#endif
                        rc = KCipherByteMake (new_cipher, type);
#if 0
#if USE_SLOW_ONES
                    }
                }
            }
#endif
        }
    }
#endif
    return rc;
}
开发者ID:gconcepcion,项目名称:sratoolkit,代码行数:35,代码来源:cipher.c


示例4: walk_spot_group

static rc_t walk_spot_group( walk_data * data, walk_funcs * funcs )
{
    rc_t rc;
    do
    {
        rc = ReferenceIteratorNextSpotGroup ( data->ref_iter, &data->spotgroup, &data->spotgroup_len );
        if ( GetRCState( rc ) != rcDone )
        {
            if ( rc != 0 )
            {
                LOGERR( klogInt, rc, "ReferenceIteratorNextPos() failed" );
            }
            else
            {
                if ( funcs->on_enter_spotgroup != NULL )
                    rc = funcs->on_enter_spotgroup( data );
                if ( rc == 0 )
                    rc = walk_placements( data, funcs );
                if ( rc == 0 && funcs->on_exit_spotgroup != NULL )
                    rc = funcs->on_exit_spotgroup( data );
            }
        }
    } while ( rc == 0 );
    if ( GetRCState( rc ) == rcDone ) { rc = 0; }
    return rc;
}
开发者ID:Bhumi28,项目名称:sra-tools,代码行数:26,代码来源:ref_walker_0.c


示例5: walk_ref_window

static rc_t walk_ref_window( walk_data * data, walk_funcs * funcs )
{
    rc_t rc;
    do
    {
        rc = ReferenceIteratorNextWindow ( data->ref_iter, &data->ref_window_start, &data->ref_window_len );
        if ( GetRCState( rc ) != rcDone )
        {
            if ( rc != 0 )
            {
                LOGERR( klogInt, rc, "ReferenceIteratorNextWindow() failed" );
            }
            else
            {
                if ( funcs->on_enter_ref_window != NULL )
                    rc = funcs->on_enter_ref_window( data );
                if ( rc == 0 )
                    rc = walk_ref_pos( data, funcs );
                if ( rc == 0 && funcs->on_exit_ref_window != NULL )
                    rc = funcs->on_exit_ref_window( data );
            }
        }
    } while ( rc == 0 );
    if ( GetRCState( rc ) == rcDone ) { rc = 0; }
    return rc;
}
开发者ID:Bhumi28,项目名称:sra-tools,代码行数:26,代码来源:ref_walker_0.c


示例6: SRAReader_ColumnsOpen

static
rc_t SRAReader_ColumnsOpen(SRAReader *self)
{
    rc_t rc = 0;
    int i = 0;

    while(self->cols[i].name != NULL) {
        if( self->cols[i].opt == SRAREADER_COL_MANDATORY || (self->options & self->cols[i].opt) ) {
            rc = SRATableOpenColumnRead(self->table, &self->cols[i].col, self->cols[i].name, self->cols[i].datatype);
            if( rc != 0 ) {
                if( ((self->cols[i].opt & SRAREADER_COL_OPTIONAL) && GetRCState(rc) == rcNotFound) ) {
                    PLOGERR(klogInfo, (klogWarn, rc, "column $(c)", PLOG_S(c), self->cols[i].name));
                    rc = 0;
                } else if( GetRCState(rc) == rcExists ) {
                    rc = 0;
                } else {
                    PLOGERR(klogInfo, (klogErr, rc, "column $(c)", PLOG_S(c), self->cols[i].name));
                    break;
                }
            }
        }
        i++;
    }
    return rc;
}
开发者ID:ImAWolf,项目名称:ncbi-vdb,代码行数:25,代码来源:reader-cmn.c


示例7: SDataPrepareCols

static rc_t SDataPrepareCols(struct SData* self,
    const char* rdFilterName, const char* readFilterName)
{
    rc_t rc = 0;

    assert(self);

    if (rc == 0) {
        const char name[] = "NREADS";
        rc = SRATableOpenColumnRead(self->_rdTbl,
            &self->_NReadsCol, name, vdb_uint8_t);
        if (rc != 0) {
            if (GetRCState(rc) == rcNotFound) {
                rc = 0;
            }
            else {
                plogerr(klogErr, rc,
                    "while calling SRATableOpenColumnRead($name)", "name=%s",
                    name);
            }
        }
    }

    /* It the physical column exists, open it */
    if (rc == 0) {
        rc = SRATableOpenColumnRead(self->_rdTbl,
            &self->_origFilterCol, rdFilterName, sra_read_filter_t);
        if (rc == 0) {
            plogmsg(klogDebug1,
                "Found '$(name)' column", "name=%s", rdFilterName);
            self->_existedRD_FILTER = true;
            self->_origFilterColName = rdFilterName;
        }
        else if (GetRCState(rc) == rcNotFound) {
            plogmsg(klogDebug1,
                "Column '$(name)' does not exist", "name=%s", rdFilterName);
            rc = 0;
        }
        else {
            plogerr(klogErr, rc, "while calling SRATableOpenColumnRead($name)",
                "name=%s", rdFilterName);
        }
    }

    /* Otherwise open the virtual one */
    if (rc == 0 && ! self->_existedRD_FILTER) {
        rc = SRATableOpenColumnRead(self->_rdTbl,
            &self->_origFilterCol, readFilterName, sra_read_filter_t);
        if (rc != 0) {
            plogerr(klogErr, rc,
                "while calling SRATableOpenColumnRead($name)", "name=%s",
                readFilterName);
        }
    }

    return rc;
}
开发者ID:Bhumi28,项目名称:sra-tools,代码行数:57,代码来源:rd-filter-redact.c


示例8: SFFLoaderFmtWriteDataFile

static
rc_t SFFLoaderFmtWriteDataFile(SFFLoaderFmt* self, const SRALoaderFile* file)
{
    rc_t rc = 0;

    while( rc == 0 ) {
        if( self->curr_read_number == 0 ) {
            if( (rc = SFFLoaderFmtReadCommonHeader(self, file)) == 0 ) {
                DEBUG_MSG (5, ("%s: Common header ok: %u reads\n", self->file_name, self->header.number_of_reads));
                DEBUG_MSG (8, ("%s: flow_chars: [%hu] %s\n", self->file_name, self->header.num_flows_per_read, self->flow_chars.data));
                DEBUG_MSG (8, ("%s: key_seq: [%hu] %s\n", self->file_name, self->header.key_length, self->key_seq.data));
            } else if( GetRCObject(rc) == (enum RCObject)rcData && GetRCState(rc) == rcIgnored ) {
                rc = 0;
                break;
            }
        }
        if( rc == 0 && self->header.number_of_reads != 0 && 
            (rc = SFFLoaderFmtSkipIndex(self, file)) == 0 &&
            (rc = SFFLoaderFmtReadDataHeader(self, file)) == 0 &&
            (rc = SFFLoaderFmtReadData(self, file)) == 0 ) {
            if( self->w454 ) {
                rc = SRAWriter454_WriteRead(self->w454, file, &self->name, &self->read, &self->quality,
                                         self->skip_signal ? NULL : &self->signal,
                                         self->skip_signal ? NULL : &self->position,
                                         self->read_header.clip_quality_left, self->read_header.clip_quality_right,
                                         self->read_header.clip_adapter_left, self->read_header.clip_adapter_right);
            } else {
                rc = SRAWriterIonTorrent_WriteRead(self->wIonTorrent, file, &self->name, &self->read, &self->quality,
                         self->skip_signal ? NULL : &self->signal,
                         self->skip_signal ? NULL : &self->position,
                         self->read_header.clip_quality_left, self->read_header.clip_quality_right,
                         self->read_header.clip_adapter_left, self->read_header.clip_adapter_right);
            }
            if( rc == 0 ) {
                ++self->curr_read_number;
            }
        }
        if( rc != 0 && (GetRCObject(rc) != rcTransfer && GetRCState(rc) != rcDone) ) {
            SRALoaderFile_LOG(file, klogErr, rc, "on or about read #$(i)", PLOG_U32(i), self->curr_read_number + 1);
        } else if( self->curr_read_number == self->header.number_of_reads ) {
            DEBUG_MSG(5, ("%s: done loading declared %u reads\n", self->file_name, self->curr_read_number));
            self->curr_read_number = 0;
            /* will skip indexes if they are at eof */
            if( (rc = SFFLoaderFmtSkipIndex(self, file)) == 0 ) {
                /* This should be the end of file and/or beginning of next */
                if( (rc = SFFLoaderFmt_ReadBlock(self, file, 0, "EOF", false)) == 0 ) {
                    if( self->file_buf == NULL ) {
                        DEBUG_MSG(5, ("%s: EOF detected\n", self->file_name));
                        self->index_correction = 0;
                        break;
                    }
                }
            }
        }
    }
    return rc;
}
开发者ID:Jingyu9,项目名称:sra-tools,代码行数:57,代码来源:sff-fmt.c


示例9: AlignAccessAlignmentEnumeratorNext

LIB_EXPORT rc_t CC AlignAccessAlignmentEnumeratorNext(const AlignAccessAlignmentEnumerator *cself) {
    rc_t rc;
    AlignAccessAlignmentEnumerator *self = (AlignAccessAlignmentEnumerator *)cself;
    int32_t refSeqID;

AGAIN:
    if (self->innerSelf != NULL) {
        BAMAlignmentRelease(self->innerSelf);
        self->innerSelf = NULL;
    }
    if (self->atend != 0)
        return AlignAccessAlignmentEnumeratorEOFCode;
    
    if (self->slice == NULL) {
        rc = BAMFileRead2(self->parent->innerSelf, &self->innerSelf);
        if (rc) {
            if (GetRCState(rc) == rcNotFound && GetRCObject(rc) == rcRow) {
                self->atend = 1;
                rc = AlignAccessAlignmentEnumeratorEOFCode;
            }
        }
        return rc;
    }
    rc = BAMFileReadSlice(self->parent->innerSelf, &self->innerSelf, self->slice);
    if (rc) {
        if (GetRCState(rc) == rcNotFound && GetRCObject(rc) == rcRow) {
            self->atend = 1;
            rc = AlignAccessAlignmentEnumeratorEOFCode;
        }
        return rc;
    }
    if (!BAMAlignmentIsMapped(self->innerSelf))
        goto AGAIN;

    BAMAlignmentGetRefSeqId(self->innerSelf, &refSeqID);
    if (self->refSeqID != refSeqID) {
        self->atend = 1;
        rc = AlignAccessAlignmentEnumeratorEOFCode;
    }
    else if (self->endpos != 0) {
        int64_t pos;
        uint32_t length;

        BAMAlignmentGetPosition2(self->innerSelf, &pos, &length);
        if (pos >= (int64_t)self->endpos) {
            self->atend = 1;
            rc = AlignAccessAlignmentEnumeratorEOFCode;
        }
        else {
            int64_t const endpos = pos + length;
            if (endpos <= self->startpos)
                goto AGAIN;
        }
    }
    return rc;
}
开发者ID:ncbi,项目名称:ncbi-vdb,代码行数:56,代码来源:align-access.c


示例10: bam_header

static rc_t bam_header(const VDatabase* db) {
    rc_t rc = 0;
    const char path[] = "BAM_HEADER";
    const KMetadata* meta = NULL;
    const KMDataNode* node = NULL;
    char* buffer = NULL;
    assert(db);
    if (rc == 0) {
        rc = VDatabaseOpenMetadataRead(db, &meta);
        DISP_RC(rc, "while calling VDatabaseOpenMetadataRead");
    }
    if (rc == 0) {
        rc = KMetadataOpenNodeRead(meta, &node, "%s", path);
        if (GetRCState(rc) == rcNotFound)
        {   rc = 0; }
        else {
            DISP_RC2(rc, path, "while calling KMetadataOpenNodeRead");
            if (rc == 0) {
                int i = 0;
                size_t bsize = 0;
                size_t size = 1024;
                for (i = 0; i < 2; ++i) {
                    free(buffer);
                    bsize = size + 1;
                    buffer = malloc(bsize);
                    if (buffer == NULL) {
                        rc = RC(rcExe, rcStorage, rcAllocating,
                            rcMemory, rcExhausted);
                    }
                    else {
                        rc = KMDataNodeReadCString(node, buffer, bsize, &size);
                        if (rc == 0) {
                            break;
                        }
                        else if (i == 0
                            && GetRCObject(rc) == (enum RCObject)rcBuffer
                            && GetRCState (rc) ==          rcInsufficient)
                        {
                            rc = 0;
                        }
                    }
                    DISP_RC2(rc, path, "while calling KMDataNodeReadCString");
                }
            }
        }
    }
    if (rc == 0 && buffer)
    {   OUTMSG(("BAM_HEADER: {\n%s}\n\n", buffer)); }
    DESTRUCT(KMDataNode, node);
    DESTRUCT(KMetadata, meta);
    free(buffer);
    return rc;
}
开发者ID:Bhumi28,项目名称:sra-tools,代码行数:53,代码来源:align-info.c


示例11: RefPosMake

static
rc_t RefPosMake ( RefPos **objp, const VTable *tbl, const VCursor *native_curs )
{
    rc_t rc;

    /* create the object */
    RefPos *obj = malloc ( sizeof * obj );
    if ( obj == NULL ) {
        rc = RC ( rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted );
    } else {
	obj->curs=NULL;
        BSTreeInit(&obj->tr_range);
        /* open the reference table cursor*/
	  
	if( (rc = AlignRefTableCursor(tbl, native_curs, &obj->curs, NULL)) == 0 ) {
                uint32_t itmp;
                if(  (rc = VCursorAddColumn(obj->curs, &itmp, "(U32)MAX_SEQ_LEN")) == 0 || GetRCState(rc) == rcExists)  {
                    const void *base;
                    uint32_t row_len;
                    rc = VCursorCellDataDirect(obj->curs, 1, itmp, NULL, &base, NULL, &row_len);
                    if(rc == 0) {
                        assert(row_len == 1);
                        memcpy(&obj->max_seq_len, base, 4);
                    }
                }
                if( GetRCObject(rc) == rcColumn && GetRCState(rc) == rcNotFound ) {
		    /*** no MAX_SEQ_LEN means that REF_POS==REF_START **/
		    VCursorRelease(obj->curs);
		    obj->curs = NULL;
                    obj->max_seq_len = 0;
		    obj->name_range_idx = 0;
		    obj->name_idx = 0;
                    rc = 0;
                } else if( rc == 0 ) {
                        /* add columns to cursor */
			rc = VCursorAddColumn(obj->curs, &obj->name_idx, "(utf8)NAME");
			if(rc == 0 || GetRCState(rc) == rcExists)
				rc = VCursorAddColumn(obj->curs, &obj->name_range_idx, "NAME_RANGE");
			if(GetRCState(rc) == rcExists)
				rc = 0;
                }
        }
        if( rc == 0 ) {
            *objp = obj;
        } else {
	    VCursorRelease(obj->curs);
            free(obj);
        }
    }
    return rc;
}
开发者ID:mariux,项目名称:sratoolkit,代码行数:51,代码来源:align-ref-pos.c


示例12: LocalRefIDMake

static
rc_t LocalRefIDMake ( LocalRefID **objp, const VTable *tbl, const VCursor *native_curs)
{
    rc_t rc;
    /* create the object */
    LocalRefID *obj = malloc ( sizeof * obj );
    if ( obj == NULL )
    {
        rc = RC( rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted );
    }
    else
    {
        const VCursor *curs=NULL;
        /* open the reference table cursor*/
        rc = AlignRefTableCursor( tbl, native_curs, &curs, NULL );
        if ( rc == 0 )
        {
            uint32_t itmp;
            rc = VCursorAddColumn( curs, &itmp, "(U32)MAX_SEQ_LEN" );
            if ( rc == 0 || GetRCState( rc ) == rcExists )
            {
                const void *base;
                uint32_t row_len;
                rc = VCursorCellDataDirect( curs, 1, itmp, NULL, &base, NULL, &row_len );
                if ( rc == 0 )
                {
                    assert( row_len == 1 );
                    memmove( &obj->max_seq_len, base, 4 );
                }
            }

            if ( ( GetRCObject( rc ) == ( enum RCObject )rcColumn ) && ( GetRCState( rc ) == rcNotFound ) )
            {
                obj->max_seq_len = 0;
                rc = 0;
            }

            VCursorRelease( curs );
            if ( rc == 0 )
            {
                *objp = obj;
                return 0;
            }
        }
        free ( obj );
    }
    return rc;
}
开发者ID:ncbi,项目名称:ncbi-vdb,代码行数:48,代码来源:align-local_ref_id.c


示例13: m_Db

CVDBTable::CVDBTable(const CVDB& db,
                     const char* table_name,
                     EMissing missing)
    : m_Db(db),
      m_Name(table_name)
{
    DECLARE_SDK_GUARD();
    if ( rc_t rc = VDatabaseOpenTableRead(db, x_InitPtr(), table_name) ) {
        *x_InitPtr() = 0;
        RCState rc_state = GetRCState(rc);
        int rc_object = GetRCObject(rc);
        if ( rc_state == rcNotFound &&
             (rc_object == rcParam ||
              rc_object == rcPath) ) {
            // missing table in the DB
            if ( missing != eMissing_Throw ) {
                return;
            }
            NCBI_THROW2_FMT(CSraException, eNotFoundTable,
                            "Cannot open VDB table: "<<*this, rc);
        }
        else {
            // other errors
            NCBI_THROW2_FMT(CSraException, eOtherError,
                            "Cannot open VDB table: "<<*this, rc);
        }
    }
}
开发者ID:svn2github,项目名称:ncbi_tk,代码行数:28,代码来源:vdbread.cpp


示例14: resolve_accession

static rc_t resolve_accession( VFSManager * vfs_mgr, const char * accession, const String ** path )
{
    VResolver * resolver;
    rc_t rc = VFSManagerGetResolver( vfs_mgr, &resolver );
    if ( rc == 0 )
    {
        const VPath * vpath;
        rc = VPathMakeSysPath( ( VPath** )&vpath, accession );
        if ( rc == 0 )
        {
            const VPath * rpath;
            rc = VResolverLocal( resolver, vpath, &rpath );
            if ( GetRCState( rc ) == rcNotFound )
                rc = VResolverRemote( resolver, vpath, &rpath, NULL );
            if ( rc == 0 )
            {
                const String * s;
                rc = VPathMakeString( rpath, &s );
                if ( rc == 0 )
                {
                    rc = StringCopy ( path, s );
                    free ((void*)s);
                }
                VPathRelease ( rpath );
            }
            VPathRelease ( vpath );
        }
        VResolverRelease( resolver );
    }
    return rc;
}
开发者ID:mariux,项目名称:sratoolkit,代码行数:31,代码来源:reref.c


示例15: nxt_avail_pos_cb

static void CC nxt_avail_pos_cb( DLNode * n, void * data )
{
    pi_ref_nxt_avail_pos_ctx * ctx = ( pi_ref_nxt_avail_pos_ctx * ) data;
    if ( ctx->rc == 0 )
    {
        pi_entry * pie = ( pi_entry * )n;
        rc_t rc = PlacementIteratorNextAvailPos ( pie->pi, &(pie->nxt_avail.first), &(pie->nxt_avail.len) );
        if ( rc == 0 )
        {
/*            OUTMSG(( "nxt_avail.first=%u w.last=%u\n", pie->nxt_avail.first, pie->w.last )); */
            ( ctx->count )++;
            if ( ctx->min_pos_initialized )
            {
                if ( pie->nxt_avail.first < ctx->min_pos )
                {
                    ctx->min_pos = pie->nxt_avail.first;
                    ctx->min_len = pie->nxt_avail.len;
                }
            }
            else
            {
                ctx->min_pos = pie->nxt_avail.first;
                ctx->min_len = pie->nxt_avail.len;
                ctx->min_pos_initialized = true;
            }
        }
        else
        {
            if ( GetRCState( rc ) != rcDone )
                ctx->rc = rc;
        }
    }
}
开发者ID:gconcepcion,项目名称:sratoolkit,代码行数:33,代码来源:pl_iterator.c


示例16: IlluminaSpot_Add

rc_t IlluminaSpot_Add(IlluminaSpot* spot, const pstring* name, const pstring* barcode, const IlluminaRead* read)
{
    rc_t rc = 0;

    if( spot->nreads == 0 ) {
        rc = IlluminaSpot_Set(spot, spot->nreads++, name, barcode, read);
    } else if( pstring_cmp(spot->name, name) == 0 ) {
        /* look if same read_id was already seen in this spot */
        int32_t k;
        for(k = 0; k < spot->nreads; k++) {
            if( spot->reads[k].read_id == read->read_id ) {
                const char* field;
                rc = IlluminaSpot_Append(spot, k, barcode, read, &field);
                if( GetRCState(rc) == rcDuplicate && read->read_id == ILLUMINAWRITER_READID_NONE ) {
                    /* may be it is the case when readids are missing on defline and these are separate reads */
                    k = spot->nreads + 1;
                    rc = 0;
                } else if( rc != 0 ) {
                    PLOGERR(klogErr, (klogErr, rc, "$(field) for spot '$(s)'", PLOG_2(PLOG_S(field),PLOG_S(s)), field, spot->name->data));
                }
                break;
            }
        }
        if( rc == 0 && k >= spot->nreads ) {
            /* read was not found, adddind new read to this spot */
            rc = IlluminaSpot_Set(spot, spot->nreads++, name, barcode, read);
        }
    } else {
        rc = RC(rcSRA, rcFormatter, rcReading, rcData, rcIgnored);
    }
    return rc;
}
开发者ID:ncbi,项目名称:sra-tools,代码行数:32,代码来源:writer-illumina.c


示例17: SRAPathFindInRepo

/* FindInRepo
 *  find accession in a repository
 */
static
rc_t SRAPathFindInRepo ( const NCBISRAPath *self, NCBIRepository *repo, const char *accession, 
                         char *path, size_t path_max, size_t *rep_len, int vol_type )
{
    SRAPathString *srv;

    PATH_DEBUG (("SRAPathFindInRepo(%s)\n", AlgToStr(repo->type)));

    /* look for accession on a rep-server */
    for ( srv = ( SRAPathString* ) DLListHead ( & repo -> repsrv ); srv != NULL; srv = ( SRAPathString* ) DLNodeNext ( & srv -> n ) )
    {
        /* try with this server */
        rc_t rc = SRAPathFindOnServer ( self, repo, srv, accession, path, path_max, vol_type );
        if ( rc == 0 )
        {
            /* make sure server is at head of list */
            if ( DLNodePrev ( & srv -> n ) != NULL )
            {
                DLListUnlink ( & repo -> repsrv, & srv -> n );
                DLListPushHead ( & repo -> repsrv, & srv -> n );
            }

            if ( rep_len != NULL )
                * rep_len = strlen ( srv -> path );
            
            return 0;
        }

        if ( GetRCState ( rc ) != rcNotFound )
            return rc;
    }

    return RC ( rcSRA, rcMgr, rcSelecting, rcPath, rcNotFound );
}
开发者ID:gconcepcion,项目名称:sratoolkit,代码行数:37,代码来源:srapath.c


示例18: TableWriterSeq_CollectStatistics

static rc_t TableWriterSeq_CollectStatistics(TableWriterSeq *self, const TableWriterData* primary_alignment_id)
{
    rc_t rc;
    int64_t mate[2] = {0, 0};
    uint64_t distance = 0;
    uint64_t count = 0;
    
    memcpy(mate, primary_alignment_id->buffer, sizeof(mate[0]) * primary_alignment_id->elements);
    if (mate[0] && mate[1]) {
        distance = (mate[0] < mate[1]) ? (mate[1] - mate[0]) : (mate[0] - mate[1]);
    }
    else
        return 0;
    if (self->stats == NULL) {
        rc = KVectorMake(&self->stats); if (rc) return rc;
    }
    rc = KVectorGetU64(self->stats, distance, &count);
    if (GetRCObject(rc) == rcItem && GetRCState(rc) == rcNotFound) {
        rc = KVectorSetU64(self->stats, distance, 1);
        if (rc == 0) ++self->statsCount;
    }
    else if (rc == 0) {
        ++count;
        rc = KVectorSetU64(self->stats, distance, count);
    }
    return rc;
}
开发者ID:thelegend6420,项目名称:ncbi-vdb,代码行数:27,代码来源:writer-sequence.c


示例19: ReferenceIteratorNextPos

LIB_EXPORT rc_t CC ReferenceIteratorNextPos ( ReferenceIterator *self, bool skip_empty )
{
    rc_t rc = 0;
    if ( self == NULL )
        rc = RC( rcAlign, rcIterator, rcAccessing, rcSelf, rcNull );
    else
    {
        self->current_rec = NULL;
        if ( self->need_init )
        {
            rc = first_ref_iter_nxt_pos( self, skip_empty );
        }
        else
        {
            /* increment the current position */
            self->current_pos++;

            if ( self->current_pos <= self->last_pos )
            {
                /* jump over gaps, if requested ... */
                if ( self->depth == 0 && skip_empty )
                {
                    self->current_pos = self->nxt_avail_pos;
                }

                /* increment the internal alignment-iterator of every placement-record */
                inc_alignment_iterators( &self->spot_groups, self->current_pos );

                /* loop through the list to look if we have to remove records,
                   that do end before this new position */
                self->depth = remove_invalid_records( self->refobj, &self->spot_groups, self->current_pos );

                rc = fill_recordlist( self, self->current_pos );
                if ( rc == 0 )
                {
                    self->current_spot_group = NULL;
                    /* set our sights to the next position... */
                    rc = PlacementSetIteratorNextAvailPos ( self->pl_set_iter, &self->nxt_avail_pos, NULL );
                    if ( GetRCState( rc ) == rcDone )
                    {
                        if ( self->depth > 0 )
                        {
                            rc = 0;
                        }
                        else if ( !skip_empty )
                        {
                            if ( self->current_pos <= self->last_pos ) rc = 0;
                        }
                    }
                }
            }
            else
            {
                rc = SILENT_RC( rcAlign, rcIterator, rcAccessing, rcOffset, rcDone );
                clear_spot_group_list( &self->spot_groups );
            }
        }
    }
    return rc;
}
开发者ID:gconcepcion,项目名称:sratoolkit,代码行数:60,代码来源:ref_iterator.c


示例20: BufferQRelease

rc_t BufferQRelease (const BufferQ *cself)
{
    BufferQ * self  = (BufferQ*)cself;
    rc_t rc = 0;
    if ( self != NULL )
    {
        if ( atomic32_dec_and_test (&self->refcount))
        {
	    const Buffer * b;
	    while (rc == 0)
	    {
		rc = BufferQPopBuffer (self, &b, NULL);
		BufferRelease (b);
	    }
/* this might need rework especially if KQueue changes */
	    if ((GetRCState(rc) == rcExhausted) && (GetRCObject(rc) == rcTimeout))
		rc = 0;
	    if (rc == 0)
	    {
		rc = KQueueRelease (self->q);
		if (rc == 0)
		{
		    free (self);
		    return 0;
		}
	    }
	    atomic32_inc (&((BufferQ*)self)->refcount);
        }
    }
    return rc;
}
开发者ID:Bhumi28,项目名称:sra-tools,代码行数:31,代码来源:ccbufferq.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetRValue函数代码示例发布时间:2022-05-30
下一篇:
C++ GetQuotedFullIdentifier函数代码示例发布时间: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