LIB_EXPORT rc_t CC XFSGapKartNodeMake ( struct XFSNode ** Node, const char * Name, uint32_t ProjectId, const char * Perm ) { rc_t RCt; struct XFSKartNode * KartNode; RCt = 0; KartNode = NULL; XFS_CSAN ( Node ) XFS_CAN ( Node ) XFS_CAN ( Name ) KartNode = calloc ( 1, sizeof ( struct XFSKartNode ) ); if ( KartNode == NULL ) { RCt = XFS_RC ( rcExhausted ); } else { RCt = XFSContNodeInit ( & ( KartNode -> node . node ), Name, Perm, _sFlavorOfGapKart, _KartNodeDispose ); if ( RCt == 0 ) { KartNode -> project_id = ProjectId; RCt = _LoadKart ( KartNode ); if ( RCt == 0 ) { * Node = ( struct XFSNode * ) KartNode; } } } if ( RCt != 0 ) { * Node = NULL; if ( KartNode != NULL ) { XFSNodeDispose ( & ( KartNode -> node . node ) ); KartNode = NULL; } } /* pLogMsg ( klogDebug, "XFSGapKartNodeMake ND[$(node)] NM[$(name)] TP[$(project_id)]", "node=%p,name=%s,project_id=%d", ( void * ) Node, Name, ProjectId ); */ return RCt; } /* XFSGapKartNodeMake () */
static rc_t CC _KartCollectionNodeMake ( const char * Name, const char * Path, /* Could be NULL */ const char * Perm, struct XFSKartCollectionNode ** Node ) { rc_t RCt; struct XFSKartCollectionNode * KartNode; RCt = 0; KartNode = NULL; if ( Node != NULL ) { * Node = NULL; } if ( Node == NULL || Path == NULL || Name == NULL ) { return XFS_RC ( rcNull ); } KartNode = calloc ( 1, sizeof ( struct XFSKartCollectionNode ) ); if ( KartNode == NULL ) { RCt = XFS_RC ( rcExhausted ); } else { RCt = XFSContNodeInit ( & ( KartNode -> node . node ), Name, Perm, _sFlavorOfKartCollection, _KartCollectionNodeDispose ); if ( RCt == 0 ) { RCt = XFS_StrDup ( Path, & ( KartNode -> path ) ); if ( RCt == 0 ) { * Node = KartNode; } } } return RCt; } /* _KartCollectionNodeMake () */