24 lines
506 B
C
24 lines
506 B
C
|
#include "motifs.h"
|
||
|
|
||
|
void ajouterMotif(int nbrPortees, int nbrTmp){
|
||
|
Motif m = malloc(nbrPortees*sizeof(Portee));
|
||
|
int i;
|
||
|
for (i=0; i<nbrPortees; i++) {
|
||
|
m[i] = malloc(nbrTmp*sizeof(Note));
|
||
|
}
|
||
|
Liste* l = malloc(sizeof(Liste));
|
||
|
l->suivant = tab;
|
||
|
tab = l;
|
||
|
}
|
||
|
|
||
|
void supprimerMotif(Liste** cellule, int nbrPortees){
|
||
|
int i;
|
||
|
for (i=0; i<nbrPortees; i++) {
|
||
|
free((*cellule)->motif[i]);
|
||
|
}
|
||
|
free((*cellule)->motif);
|
||
|
Liste* aux = (*cellule)->suivant;
|
||
|
free((*cellule));
|
||
|
*cellule = aux;
|
||
|
}
|