Exemplo n.º 1
0
Status destroyLinkedList(LinkedList *L){
	assert(*L);
	clearLinkedList(*L);
	free(*L);
	*L = NULL;
	return OK;
}
Exemplo n.º 2
0
void deleteLinkedList(LinkedList* pList)
{
	int i = 0;
	if (pList != NULL) {
		clearLinkedList(pList);
		free(pList);
	}
}
Exemplo n.º 3
0
void clearLinkedList(struct Node *n){
	if(!n){
		return;
	}
	else{
		clearLinkedList(n->next);
		free(n);
	}
}
Exemplo n.º 4
0
static void poseCommanderCrtpCB(CRTPPacket* pk) {
    DesiredPoseCrtpValues desiredCrtpPose = *((DesiredPoseCrtpValues*) pk->data);
    Pose desiredPose;
    desiredPose.x = desiredCrtpPose.x;
    desiredPose.y = desiredCrtpPose.y;
    desiredPose.z = desiredCrtpPose.z;
    desiredPose.yaw = desiredCrtpPose.yaw;
    id = desiredCrtpPose.index;
    if(desiredCrtpPose.index == 0) {
        clearLinkedList(&desiredPoses);
    } else {
        addDesiredPose(&desiredPose);
    }
}