Example #1
0
rc_t nlt_copy_namelist( const KNamelist *src, const KNamelist ** dst )
{
    VNamelist *v_names;
    rc_t rc = VNamelistMake ( &v_names, 5 );
    if ( rc == 0 )
    {
        uint32_t count;
        rc = KNamelistCount( src, &count );
        if ( rc == 0 )
        {
            uint32_t idx;
            for ( idx = 0; idx < count && rc == 0; ++idx )
            {
                const char *s;
                rc = KNamelistGet( src, idx, &s );
                if ( rc == 0 && s != NULL )
                    rc = VNamelistAppend ( v_names, s );
            }
        }
        if ( rc == 0 )
            rc = VNamelistToConstNamelist ( v_names, dst );
        VNamelistRelease( v_names );
    }
    return rc;
}
Example #2
0
rc_t nlt_remove_names_from_namelist( const KNamelist *source,
                                     const KNamelist **dest, const KNamelist *to_remove )
{
    rc_t rc = 0;
    uint32_t count;

    if ( source == NULL || dest == NULL || to_remove == NULL )
        return RC( rcVDB, rcNoTarg, rcConstructing, rcParam, rcNull );
    *dest = NULL;
    rc = KNamelistCount( source, &count );
    if ( rc == 0 && count > 0 )
    {
        VNamelist *cleaned;
        rc = VNamelistMake ( &cleaned, count );
        if ( rc == 0 )
        {
            uint32_t idx;
            for ( idx = 0; idx < count && rc == 0; ++idx )
            {
                const char *s;
                rc = KNamelistGet( source, idx, &s );
                if ( rc == 0 )
                {
                    if ( !nlt_is_name_in_namelist( to_remove, s ) )
                        rc = VNamelistAppend ( cleaned, s );
                }
                rc = VNamelistToConstNamelist ( cleaned, dest );
            }
        }
    }
    return rc;
}
Example #3
0
rc_t vds_path_to_sections( const char * path, char delim, VNamelist ** sections )
{
    rc_t rc = 0;
    if ( path == NULL || sections == NULL )
        rc = RC( rcVDB, rcNoTarg, rcInserting, rcParam, rcNull );
    else
    {
        rc = VNamelistMake ( sections, 5 );
        if ( rc == 0 )
        {
            uint32_t idx = 0, start = 0, len = 0;
            while( rc== 0 && path[ idx ] != 0 )
            {
                if ( path[ idx ] == delim )
                {
                    if ( len > 0 )
                        rc = vds_add_to_sections( path, start, len, *sections );
                    start = idx + 1;
                    len = 0;
                }
                else
                {
                    len++;
                }
                idx++;
            }
            if ( rc == 0 && len > 0 )
                rc = vds_add_to_sections( path, start, len, *sections );
        }
    }
    return rc;
}
Example #4
0
rc_t make_column_namelist ( const BSTree *columns, KNamelist **names )
{
    VNamelist *list;
    rc_t rc = VNamelistMake ( & list, 8 );
    if ( rc == 0 )
    {
        const String *last = NULL;
        const VColumnRef *cref = ( const VColumnRef* )
            BSTreeFirst ( columns );
        while ( cref != NULL )
        {
            if ( last == NULL || ! StringEqual ( last, & cref -> name ) )
            {
                rc = VNamelistAppend ( list, cref -> name . addr );
                if ( rc != 0 )
                    break;

                last = & cref -> name;
            }

            cref = ( const VColumnRef* )
                BSTNodeNext ( & cref -> n );
        }

        if ( rc == 0 )
            rc = VNamelistToNamelist ( list, names );

        VNamelistRelease ( list );
    }

    return rc;
}
Example #5
0
static rc_t ref_walker_init( struct ref_walker * self )
{
    rc_t rc = KDirectoryNativeDir( &self->dir );
    if ( rc == 0 )
        rc = VDBManagerMakeRead ( &self->vmgr, self->dir );
    if ( rc == 0 )
        rc = VDBManagerMakeSRASchema( self->vmgr, &self->vschema );
    if ( rc == 0 )
        rc = AlignMgrMakeRead ( &self->amgr );
    if ( rc == 0 )
        rc =  VFSManagerMake ( &self->vfs_mgr );        
    if ( rc == 0 )
        rc = VNamelistMake ( &self->sources, 10 );

    self->cb_block.data = self;
    self->cb_block.destroy = NULL;
    self->cb_block.populate = populate_data;
    self->cb_block.alloc_size = alloc_size;
    self->cb_block.fixed_size = 0;

    BSTreeInit( &self->regions );
    self->primary_alignments = true;
    
    if ( rc != 0 )
        ref_walker_release( self );
    return rc;
}
Example #6
0
LIB_EXPORT
rc_t CC
XFSOwpListKeys (
            const struct XFSOwp * self,
            const struct KNamelist ** Keys
)
{
    rc_t RCt;
    struct VNamelist * List;

    RCt = 0;

    if ( self == NULL || Keys == NULL ) {
        return XFS_RC ( rcNull );
    }

    * Keys = NULL;

    RCt = VNamelistMake ( & List, 16 /* ?? */ );
    if ( RCt == 0 ) {
        BSTreeForEach (
                    ( BSTree * ) self,
                    false,
                    _ListKeysCallback,
                    List
                    );

        RCt = VNamelistToConstNamelist ( List, Keys );

        VNamelistRelease ( List );
    }

    return RCt;
}   /* XFSOwpListKeys () */
Example #7
0
rc_t nlt_build_intersect( const KNamelist *nl1, const KNamelist *nl2, const KNamelist ** dst )
{
    VNamelist *v_names;
    rc_t rc = VNamelistMake ( &v_names, 5 );
	if ( rc == 0 )
	{
		/* loop through nl1: if a entry is found in nl2 -> add it to dst */
		uint32_t count;
		rc = KNamelistCount( nl1, &count );
		if ( rc == 0 )
		{
            uint32_t idx;
            for ( idx = 0; idx < count && rc == 0; ++idx )
            {
                const char *s;
                rc = KNamelistGet( nl1, idx, &s );
				if ( rc == 0 && s != NULL )
				{
					if ( nlt_is_name_in_namelist( nl2, s ) )
						rc = VNamelistAppend ( v_names, s );
				}
			}
		}
		if ( rc == 0 )
			rc = VNamelistToConstNamelist ( v_names, dst );
        VNamelistRelease( v_names );

	}
	return rc;	
}
Example #8
0
rc_t register_temp_file( temp_registry * self, uint32_t read_id, const char * filename )
{
    rc_t rc = 0;
    if ( self == NULL )
        rc = RC( rcVDB, rcNoTarg, rcConstructing, rcSelf, rcNull );
    else if ( filename == NULL )
        rc = RC( rcVDB, rcNoTarg, rcConstructing, rcParam, rcNull );
    else
    {
        rc = KLockAcquire ( self -> lock );
        if ( rc == 0 )
        {
            VNamelist * l = VectorGet ( &self -> lists, read_id );
            if ( l == NULL )
            {
                rc = VNamelistMake ( &l, 12 );
                if ( rc == 0 )
                {
                    rc = VectorSet ( &self -> lists, read_id, l );
                    if ( rc != 0 )
                        VNamelistRelease ( l );
                }
            }
            if ( rc == 0 && l != NULL )
            {
                rc = VNamelistAppend ( l, filename );
                if ( rc == 0 )
                    rc = Add_File_to_Cleanup_Task ( self -> cleanup_task, filename );
            }
            KLockUnlock ( self -> lock );
        }
    }
    return rc;
}
Example #9
0
static bool context_init( context **ctx )
{
    bool res = false;
    if ( ctx != NULL )
    {
        (*ctx) = malloc( sizeof( context ) );
        if ( *ctx )
        {
            (*ctx)->output_file = NULL;
            (*ctx)->dependency_file = NULL;
            VNamelistMake( &( (*ctx)->include_files ), 5 );
            VNamelistMake( &( (*ctx)->src_files ), 5 );
            res = true;
        }
    }
    return res;
}
Example #10
0
rc_t clear_cgi_request_params( struct cgi_request * request )
{
    rc_t rc;
    if ( request == NULL )
        rc = RC( rcVDB, rcNoTarg, rcConstructing, rcParam, rcNull );
    else
    {
        if ( request->params != NULL )
        {
            rc = VNamelistRelease( request->params );
            if ( rc == 0 )
                rc = VNamelistMake( &request->params, 10 );
        }
    }
    return rc;
}
Example #11
0
rc_t make_column_typelist ( const BSTree *columns,
    const char *col, uint32_t *dflt_idx, KNamelist **typedecls )
{
    VNamelist *list;
    rc_t rc = VNamelistMake ( & list, 8 );
    if ( rc == 0 )
    {
        uint32_t idx;
        const VColumnRef *first;

        String col_name;
        StringInitCString ( & col_name, col );

        first = ( const VColumnRef* )
            BSTreeFind ( columns, & col_name, VColumnRefCmpString );
        if ( first != NULL )
        {
            const VColumnRef *cref = ( const VColumnRef* ) BSTNodePrev ( & first -> n );
            while ( cref != NULL && StringEqual ( & first -> name, & cref -> name ) )
            {
                first = cref;
                cref = ( const VColumnRef* ) BSTNodePrev ( & cref -> n );
            }

            for ( cref = first, idx = 0; ; ++ idx )
            {
                rc = VNamelistAppend ( list, cref -> typedecl );
                if ( rc != 0 )
                    break;

                if ( cref -> dflt )
                    * dflt_idx = idx;

                cref = ( const VColumnRef* ) BSTNodeNext ( & cref -> n );
                if ( cref == NULL || ! StringEqual ( & first -> name, & cref -> name ) )
                    break;
            }
        }

        if ( rc == 0 )
            rc = VNamelistToNamelist ( list, typedecls );

        VNamelistRelease ( list );
    }

    return rc;
}
Example #12
0
static rc_t init_tool_options( tool_options * options )
{
    rc_t rc = VNamelistMake ( &options->paths, 5 );
    if ( rc != 0 )
    {
        PLOGERR( klogErr, ( klogErr, rc,
                 "VNamelistMake() failed in $(func)", "func=%s", __func__ ) );
    }
    else
    {
        options->path_count = 0;
        options->main_function = tf_unknown;
        options->user_repo_name = NULL;
        options->max_remove = 0;
    }
    return rc;
}
Example #13
0
static rc_t print_headers_by_recalculating( const samdump_opts * opts, input_files * ifs )
{
    rc_t rc = KOutMsg( "@HD\tVN:1.3\n" );
    if ( rc == 0 )
    {
        BSTree tree;

        /* collect sequenc-id's and names and their lengths, unique by sequence-id */
        BSTreeInit( &tree );
        rc = build_seq_id_tree( &tree, ifs );
        if ( rc == 0 )
        {
            hdr_print_ctx hctx;
            hctx.rc = 0;
            hctx.use_seq_id = opts->use_seqid_as_refname;
            /* ptrint it */
            BSTreeForEach( &tree, false, print_header_callback, &hctx );
            rc = hctx.rc;
        }
        free_seq_id_tree( &tree );

        /* collect spot-groups ( unique ) */
        if ( rc == 0 )
        {
            VNamelist * spotgroups;
            rc = VNamelistMake( &spotgroups, 10 );
            if ( rc == 0 )
            {
                bool from_stats = false;
                rc = extract_spotgroups( spotgroups, ifs, from_stats );
                if ( rc == 0 )
                    rc = print_spotgroups( spotgroups, from_stats );
                else
                    rc = 0; /* otherwise the tool would be not able to handle something that has no headers */
                VNamelistRelease( spotgroups );
            }
        }
    }
    return rc;
}
Example #14
0
rc_t report_set_columns( p_report self, size_t count, ... )
{
    rc_t rc;
    if ( self != NULL )
    {
        VNamelistRelease ( self->columns ); /* ignores NULL */
        rc = VNamelistMake ( &self->columns, count );
        if ( rc == 0 )
        {
            self->col_count = count;
            if ( self->max_width != NULL )
                free( self->max_width );
            self->max_width = malloc( count * sizeof( *self->max_width ) );
            if ( self->max_width == NULL )
                rc = RC( rcExe, rcNoTarg, rcConstructing, rcMemory, rcExhausted );

            if ( rc == 0 )
            {
                size_t idx;
                va_list args;

                va_start ( args, count );
                for ( idx = 0; idx < count && rc == 0; ++idx )
                {
                    const char * s = va_arg( args, const char * );
                    if ( s != NULL )
                    {
                        rc = VNamelistAppend ( self->columns, s );
                        self->max_width[ idx ] = string_size( s );
                    }
                    else
                    {
                        rc = VNamelistAppend ( self->columns, "." );
                        self->max_width[ idx ] = 1;
                    }
                }
                va_end ( args );
            }
Example #15
0
LIB_EXPORT rc_t CC KDlsetList ( const KDlset *self, KNamelist **listp )
{
    list_dylib_param pb;

    assert ( listp != NULL );

    if ( self == NULL )
        pb . rc = RC ( rcFS, rcDylib, rcListing, rcSelf, rcNull );
    else
    {
        pb . rc = VNamelistMake ( & pb . list, VectorLength ( & self -> name ) );
        if ( pb . rc == 0 )
        {
            bool fail = VectorDoUntil ( & self -> name, false, list_dylib, & pb );
            if ( ! fail )
                pb . rc = VNamelistToNamelist ( pb . list, listp );

            VNamelistRelease ( pb . list );
        }
    }

    return pb . rc;
}
Example #16
0
rc_t make_cgi_request( struct cgi_request ** request, const char * url )
{
    rc_t rc = 0;
    cgi_request * r = calloc( 1, sizeof * r );
    if ( r == NULL )
    {
        rc = RC( rcVDB, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
        ErrMsg( "calloc( %d ) -> %R", ( sizeof * r ), rc );
    }
    else
    {
        r->url = string_dup_measure( url, NULL );
        if ( r->url == NULL )
        {
            rc = RC( rcVDB, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
            ErrMsg( "string_dup_measure( '%s' ) -> %R", url, rc );
        }
        else
        {
            DBGMSG ( DBG_APP, DBG_FLAG ( DBG_APP_1 ), ( "%s\n", r -> url ) );
            rc = VNamelistMake( &r->params, 10 );
            if ( rc != 0 )
                ErrMsg( "VNamelistMake() -> %R", rc );
            else
            {
                rc = KNSManagerMake( &r->kns_mgr );
                if ( rc != 0 )
                    ErrMsg( "KNSManagerMake() -> %R", rc );
                else
                    *request = r;
            }
        }
        if ( rc != 0 )
            release_cgi_request( r );
    }
    return rc;
}
Example #17
0
rc_t nlt_make_namelist_from_string( const KNamelist **list, const char * src )
{
    VNamelist *v_names;
    rc_t rc = VNamelistMake ( &v_names, 5 );
    if ( rc == 0 )
    {
        char * s = string_dup_measure ( src, NULL );
        if ( s )
        {
            uint32_t str_begin = 0;
            uint32_t str_end = 0;
            char c;
            do
            {
                c = s[ str_end ];
                if ( c == ',' || c == 0 )
                {
                    if ( str_begin < str_end )
                    {
                        char c_temp = c;
                        s[ str_end ] = 0;
                        rc = VNamelistAppend ( v_names, &(s[str_begin]) );
                        s[ str_end ] = c_temp;
                    }
                    str_begin = str_end + 1;
                }
                str_end++;
            } while ( c != 0 && rc == 0 );
            free( s );
        }
        if ( rc == 0 )
            rc = VNamelistToConstNamelist ( v_names, list );
        VNamelistRelease( v_names );
    }
    return rc;
}
Example #18
0
LIB_EXPORT
rc_t CC
XFS_SimpleTokenize_ZHR (
                    const char * SimpleString,
                    char Separator,
                    struct KNamelist ** Tokens
)
{
    rc_t RCt;
    struct VNamelist * List;
    char LN [ XFS_SIZE_1024 ], * LNEnd;
    const char * End;

    RCt = 0;
    List = NULL;
    LNEnd = NULL;
    End = NULL;

    if ( Tokens == NULL || SimpleString == NULL ) {
        return XFS_RC ( rcNull );
    }
    * Tokens = NULL;

    RCt = VNamelistMake ( & List, 16 /* he-he */ );
    if ( RCt == 0 ) {
        End = SimpleString;
        LNEnd = LN;

        while ( * End != 0 ) {
            * LNEnd = * End;

            if ( * End == Separator ) {
                *LNEnd = 0;

                RCt = _AddTrimStringToList_ZHR ( List, LN );
                if ( RCt != 0 ) {
                    break;
                }

                LNEnd = LN;
                End ++;
            }
            else {
                End ++;
                LNEnd ++;
            }

        }

        if ( RCt == 0 ) {
            if ( LN != LNEnd ) {
                * LNEnd = 0;
                RCt = _AddTrimStringToList_ZHR ( List, LN );
            }
        }

        if ( RCt == 0 ) {
            RCt = VNamelistToNamelist ( List, Tokens );
        }

        VNamelistRelease ( List );
    }

    return RCt;
}   /* XFS_SimpleTokenize_ZHR () */
Example #19
0
static rc_t gather_string_options( Args * args, samdump_opts * opts )
{
    const char * s;
    uint32_t count;

    rc_t rc = get_str_option( args, OPT_PREFIX, &s );
    if ( rc == 0 && s != NULL )
    {
        opts->qname_prefix = string_dup_measure( s, NULL );
        if ( opts->qname_prefix == NULL )
        {
            rc = RC( rcExe, rcNoTarg, rcValidating, rcMemory, rcExhausted );
            (void)LOGERR( klogErr, rc, "error storing QNAME-PREFIX" );
        }
    }

    if ( rc == 0 )
    {
        rc = get_str_option( args, OPT_Q_QUANT, &s );
        if ( rc == 0 && s != NULL )
        {
            opts->qual_quant = string_dup_measure( s, NULL );
            if ( opts->qual_quant == NULL )
            {
                rc = RC( rcExe, rcNoTarg, rcValidating, rcMemory, rcExhausted );
                (void)LOGERR( klogErr, rc, "error storing QUAL-QUANT" );
            }
            else
            {
                bool bres = QualityQuantizerInitMatrix( opts->qual_quant_matrix, opts->qual_quant );
                if ( !bres )
                {
                    rc = RC( rcExe, rcNoTarg, rcValidating, rcParam, rcInvalid );
                    (void)LOGERR( klogErr, rc, "error initializing quality-quantizer-matrix" );
                }
            }
        }
    }

    if ( rc == 0 )
    {
        rc = get_str_option( args, OPT_OUTPUTFILE, &s );
        if ( rc == 0 && s != NULL )
        {
            opts->outputfile = string_dup_measure( s, NULL );
            if ( opts->outputfile == NULL )
            {
                rc = RC( rcExe, rcNoTarg, rcValidating, rcMemory, rcExhausted );
                (void)LOGERR( klogErr, rc, "error storing OUTPUTFILE" );
            }
        }
    }

    if ( rc == 0 )
    {
        rc = ArgsOptionCount( args, OPT_HDR_COMMENT, &count );
        if ( rc == 0 && count > 0 )
        {
            uint32_t i;
            rc = VNamelistMake( &opts->hdr_comments, 10 );
            for ( i = 0; i < count && rc == 0; ++i )
            {
                const char * src;
                rc = ArgsOptionValue( args, OPT_HDR_COMMENT, i, &src );
                if ( rc != 0 )
                {
                    (void)PLOGERR( klogErr, ( klogErr, rc, "error retrieving comandline option '$(t)' #$(n)", 
                                              "t=%s,n=%u", OPT_HDR_COMMENT, i ) );
                }
                else
                {
                    rc = VNamelistAppend( opts->hdr_comments, src );
                    if ( rc != 0 )
                    {
                        (void)PLOGERR( klogErr, ( klogErr, rc, "error appending hdr-comment '$(t)'", 
                                                  "t=%s", src ) );
                    }
                }
            }
            if ( rc != 0 )
            {
                VNamelistRelease( opts->hdr_comments );
                opts->hdr_comments = NULL;
            }
        }
    }

    if ( rc == 0 )
    {
        rc = ArgsParamCount( args, &count );
        if ( rc == 0 && count > 0 )
        {
            uint32_t i;
            rc = VNamelistMake( &opts->input_files, 10 );
            for ( i = 0; i < count && rc == 0; ++i )
            {
                const char * src;
                rc = ArgsParamValue( args, i, &src );
                if ( rc != 0 )
                {
                    (void)PLOGERR( klogErr, ( klogErr, rc, "error retrieving comandline param #$(n)", 
                                              "n=%u", i ) );
                }
                else
                {
                    rc = VNamelistAppend( opts->input_files, src );
                    if ( rc != 0 )
                    {
                        (void)PLOGERR( klogErr, ( klogErr, rc, "error appending input_file '$(t)'", 
                                                  "t=%s", src ) );
                    }
                }
            }
            if ( rc != 0 )
            {
                VNamelistRelease( opts->input_files );
                opts->input_files = NULL;
            }
        }
        opts->input_file_count = count;
    }

    rc = get_str_option( args, OPT_CIGAR_TEST, &s );
    if ( rc == 0 && s != NULL )
    {
        opts->cigar_test = string_dup_measure( s, NULL );
        if ( opts->cigar_test == NULL )
        {
            rc = RC( rcExe, rcNoTarg, rcValidating, rcMemory, rcExhausted );
            (void)LOGERR( klogErr, rc, "error storing CIGAR-TEST" );
        }
    }

    return rc;
}
Example #20
0
/* ListPhysColumns
 *  avail: 2.4
 */
LIB_EXPORT rc_t CC VTableListPhysColumns ( const VTable *self, KNamelist **names )
{
    rc_t rc;

    if ( names == NULL )
        rc = RC ( rcVDB, rcTable, rcListing, rcParam, rcNull );
    else
    {
        * names = NULL;

        if ( self == NULL )
            rc = RC ( rcVDB, rcTable, rcListing, rcSelf, rcNull );
        else
        {
            KNamelist *kcol_names;
            rc = KTableListCol ( self -> ktbl, & kcol_names );
            if ( rc == 0 )
            {
                uint32_t kcol_count;
                rc = KNamelistCount ( kcol_names, & kcol_count );
                if ( rc == 0 )
                {
                    uint32_t scol_count = 0;
                    KNamelist *scol_names = NULL;
                    const KMDataNode *col_node = self -> col_node;

#if LAZY_OPEN_COL_NODE
                    if ( col_node == NULL )
                    {
                        rc = KMetadataOpenNodeRead ( self -> meta, & ( ( VTable* ) self ) -> col_node, "col" );
                        if ( rc == 0 || GetRCState ( rc ) != rcNotFound )
                            col_node = self -> col_node;
                    }
#endif
                    if ( col_node != NULL )
                    {
                        rc = KMDataNodeListChildren ( col_node, & scol_names );
                        if ( rc == 0 )
                            rc = KNamelistCount ( scol_names, & scol_count );
                    }

                    if ( rc == 0 )
                    {
                        VNamelist *vnames;
                        rc = VNamelistMake ( & vnames, kcol_count + scol_count );
                        if ( rc == 0 )
                        {
                            uint32_t i;
                            const char *name;

                            for ( i = 0; i < kcol_count && rc == 0; ++ i )
                            {
                                rc = KNamelistGet ( kcol_names, i, & name );
                                if ( rc == 0 )
                                    rc = VNamelistAppend ( vnames, name );
                            }

                            for ( i = 0; i < scol_count && rc == 0; ++ i )
                            {
                                rc = KNamelistGet ( scol_names, i, & name );
                                if ( rc == 0 )
                                    rc = VNamelistAppend ( vnames, name );
                            }

                            if ( rc == 0 )
                            {
                                rc = VNamelistToNamelist ( vnames, names );
                                if ( rc == 0 )
                                    VNamelistReorder ( vnames, false );
                            }
                        }

                        VNamelistRelease ( vnames );
                    }

                    KNamelistRelease ( scol_names );
                }

                KNamelistRelease ( kcol_names );
            }
        }
    }

    return rc;
}
Example #21
0
static rc_t print_headers_from_file( const samdump_opts * opts )
{
    KDirectory * dir;
    rc_t rc = KDirectoryNativeDir ( &dir );
    if ( rc != 0 )
    {
        (void)PLOGERR( klogErr, ( klogErr, rc, "cant created native directory for file '$(t)'", "t=%s", opts->header_file ) );
    }
    else
    {
        const struct KFile * f;
        rc = KDirectoryOpenFileRead ( dir, &f, "%s", opts->header_file );
        if ( rc != 0 )
        {
            (void)PLOGERR( klogErr, ( klogErr, rc, "cant open file '$(t)'", "t=%s", opts->header_file ) );
        }
        else
        {
            VNamelist * headers;
            rc = VNamelistMake ( &headers, 25 );
            if ( rc != 0 )
            {
                (void)PLOGERR( klogErr, ( klogErr, rc, "cant create container for file '$(t)'", "t=%s", opts->header_file ) );
            }
            else
            {
                rc = LoadKFileToNameList( f, headers );
                if ( rc != 0 )
                {
                    (void)PLOGERR( klogErr, ( klogErr, rc, "cant load file '$(t)' into container", "t=%s", opts->header_file ) );
                }
                else
                {
                    uint32_t count;
                    rc = VNameListCount ( headers, &count );
                    if ( rc != 0 )
                    {
                        (void)PLOGERR( klogErr, ( klogErr, rc, "cant get count for container of '$(t)'", "t=%s", opts->header_file ) );
                    }
                    else
                    {
                        uint32_t i;
                        for ( i = 0; i < count && rc == 0; ++i )
                        {
                            const char * line;
                            rc = VNameListGet ( headers, i, &line );
                            if ( rc != 0 )
                            {
                                (void)PLOGERR( klogErr, ( klogErr, rc, "cant get line #$(t) from container", "t=%u", i ) );
                            }
                            else
                            {
                                rc = KOutMsg( "%s\n", line );
                            }
                        }
                    }
                }
                VNamelistRelease ( headers );
            }
            KFileRelease ( f );
        }
        KDirectoryRelease ( dir );
    }
    return rc;
}