Пример #1
0
static
rc_t CC
_EncAttr_init_check_v1 (
                const struct XFSAttrEditor * self,
                const struct XFSEncEntry ** Entry
)
{
    struct XFSEncNode * Node = NULL;

    XFS_CSAN ( Entry )

    XFS_CAN ( self )
    XFS_CAN ( Entry )


    Node = ( struct XFSEncNode * ) XFSEditorNode (
                                                & ( self -> Papahen )
                                                );

    XFS_CA ( Node, NULL )
    XFS_CA ( Node -> entry, NULL )

    * Entry = Node -> entry;

    return 0;
}   /* _EncAttr_init_check_v1 () */
Пример #2
0
/*))    Something unusual. Will check-initialize NativeDir and Node
 //     NativeDir and Node could be NULL
((*/
static
rc_t CC
_DocAttr_init_check_v1 (
                    const struct XFSAttrEditor * self,
                    const struct XFSDocNode ** Node

)
{
    rc_t RCt;
    const struct XFSDocNode * RetNode;

    RCt = 0;
    RetNode = NULL;

    if ( Node != NULL ) {
        * Node = NULL;
    }

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

    RetNode = ( const struct XFSDocNode * ) XFSEditorNode (
                                                & ( self -> Papahen )
                                                );

    if ( RetNode == NULL ) {
        return XFS_RC ( rcInvalid );
    }

    if ( RetNode -> doc == NULL ) {
        return XFS_RC ( rcInvalid );
    }

    if ( RCt == 0 ) {
        if ( Node != NULL ) {
            * Node = RetNode;
        }
    }

    return RCt;
}   /* _DocAttr_init_check_v1 () */
Пример #3
0
static
rc_t CC
_DocFile_open_v1 (
                    const struct XFSFileEditor * self,
                    XFSNMode Mode
)
{
    const struct XFSDocNode * Node;
    struct KFile * File;
    rc_t RCt;

    Node = NULL;
    File = NULL;
    RCt = 0;

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

    Node = ( const struct XFSDocNode * ) XFSEditorNode (
                                                & ( self -> Papahen )
                                                );
    if ( Node == NULL ) {
        return XFS_RC ( rcInvalid );
    }

    if ( Mode != kxfsRead ) {
        return XFS_RC ( rcInvalid );
    }

    RCt = XFSDocFileMake (
                        XFSNodeName ( & ( Node -> node ) ),
                        Node -> doc,
                        & File
                        );
    if ( RCt == 0 ) {
        ( ( struct XFSDocFileEditor * ) self ) -> file = File;
    }

    return RCt;
}   /* _DocFile_open_v1 () */
Пример #4
0
static
rc_t CC
_DocFile_size_v1 (
                        const struct XFSFileEditor * self,
                        uint64_t * Size
)
{
    const struct XFSDocNode * Node;
    uint64_t TempSize;
    rc_t RCt;

    Node = NULL;
    TempSize = 0;
    RCt = 0;

    if ( Size == NULL ) {
        return XFS_RC ( rcNull );
    }
    * Size = 0;

    Node = ( const struct XFSDocNode * ) XFSEditorNode (
                                                & ( self -> Papahen )
                                                );

    if ( Node == NULL ) {
        return XFS_RC ( rcInvalid );
    }

    if ( Node -> doc == NULL ) {
        return XFS_RC ( rcInvalid );
    }

    RCt = XFSDocSize ( Node -> doc, & TempSize );
    if ( RCt == 0 ) {
        * Size = TempSize;
    }

    return RCt;
}   /* _DocFile_size_v1 () */
Пример #5
0
static
rc_t CC
_EncFile_open_v1 (
                    const struct XFSFileEditor * self,
                    XFSNMode Mode
)
{
    rc_t RCt;
    const struct XFSEncNode * Node;
    struct XFSEncFileEditor * Editor;

    RCt = 0;
    Node = NULL;
    Editor = ( struct XFSEncFileEditor * ) self;

    if ( Mode != kxfsRead ) {
        return XFS_RC ( rcInvalid );
    }

    XFS_CAN ( self )

    Node = ( const struct XFSEncNode * ) XFSEditorNode (
                                                & ( self -> Papahen )
                                                );
    XFS_CA ( Node, NULL )
    XFS_CA ( Node -> entry, NULL )

    Editor = ( struct XFSEncFileEditor * ) self;
    if ( Editor -> entry == NULL ) {
        if ( ! XFSEncEntryIsOpen ( Node -> entry ) ) {
            RCt = XFSEncEntryOpen ( Node -> entry );
        }
        if ( RCt == 0 ) {
            Editor -> entry = Node -> entry;
        }
    }

    return RCt;
}   /* _EncFile_open_v1 () */