Example #1
0
/*)))   Attrs
 (((*/
static
rc_t CC
_BogusNodeAttr_dispose_v1 ( const struct XFSEditor * self )
{
    struct XFSAttrEditor * Editor;

    Editor = ( struct XFSAttrEditor * ) self;

/*
    printf ( " _BogusNodeAttr_dispose_ ( 0x%p )\n", ( void * ) Editor );
*/

    if ( Editor == 0 ) {
        return 0;
    }

    if ( ( Editor -> Papahen ) . Node != NULL ) {
        XFSNodeRelease ( ( Editor -> Papahen ) . Node );

        ( Editor -> Papahen ) . Node = NULL;
    }

    free ( Editor );

    return 0;
}   /* _BogusNodeAttr_dispose_v1 () */
Example #2
0
static
rc_t CC
_BogusNodeAttr_v1 (
            const struct XFSNode * self,
            const struct XFSAttrEditor ** Attr
)
{
    rc_t RCt;
    struct XFSAttrEditor * Editor;

    RCt = 0;
    Editor = NULL;

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

    Editor = calloc ( 1, sizeof ( struct XFSAttrEditor ) );
    if ( Editor == NULL ) {
        XFSNodeRelease ( self );
        return XFS_RC ( rcExhausted );
    }

    RCt = XFSEditorInit (
                        & ( Editor -> Papahen ),
                        self,
                        _BogusNodeAttr_dispose_v1
                        );

    if ( RCt == 0 ) {
        Editor -> type = _BogusNodeAttr_type_v1;

        * Attr = Editor;
    }
    else {
        free ( Editor );
    }
/*
printf ( " _BogusNodeAttr_ ( 0x%p )\n", Editor );
*/

    return RCt;
}   /* _BogusNodeAttr_v1 () */
Example #3
0
LIB_EXPORT
rc_t CC
XFSTreeDispose ( struct XFSTree * self )
{
    rc_t RCt;

    RCt = 0;

/*
printf ( " |<- ThreeDispose ( 0x%p )\n", ( void * ) self );
*/

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

    if ( self -> Root != NULL ) {
        XFSNodeRelease ( self -> Root );

        self -> Root = NULL;
    }

    if ( self -> Resource != NULL ) {
        free ( ( char * ) self -> Resource );

        self -> Resource = NULL;
    }

    if ( self -> Version != NULL ) {
        free ( ( char * ) self -> Version );

        self -> Version = NULL;
    }

    KRefcountWhack ( & ( self -> refcount ), _sXFSTree_classname );

    free ( self );

    return RCt;
}   /* XFSTreeDispose () */
Example #4
0
LIB_EXPORT
rc_t CC
XFSTreeDispose ( struct XFSTree * self )
{
    rc_t RCt;

    RCt = 0;

/*
pLogMsg ( klogDebug, " |<- TreeDispose ( $(tree) )", "tree=%p", ( void * ) self );
*/

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

    if ( self -> Root != NULL ) {
        XFSNodeRelease ( self -> Root );

        self -> Root = NULL;
    }

    if ( self -> Resource != NULL ) {
        free ( ( char * ) self -> Resource );

        self -> Resource = NULL;
    }

    if ( self -> Version != NULL ) {
        free ( ( char * ) self -> Version );

        self -> Version = NULL;
    }

    KRefcountWhack ( & ( self -> refcount ), _sXFSTree_classname );

    free ( self );

    return RCt;
}   /* XFSTreeDispose () */