#include #include #include "gst_micro_mem.h" struct mm_st { int *entree; int *mop; int nbre_mop; int **tab_micro_mem; int entree_max; }; mm_st mm_init (int *entree, int *mop, int nbre_mop, int **tab_micro_mem, int entree_max) { mm_st mm = (mm_st) malloc (sizeof (struct mm_st)); assert (mm != NULL); mm->entree = entree; mm->mop = mop; mm->nbre_mop = nbre_mop; mm->tab_micro_mem = tab_micro_mem; mm->entree_max = entree_max; return mm; } void mm_evalue (mm_st mm) { if (*mm->entree >= 0 && *mm->entree <= mm->entree_max) memcpy (mm->mop, *(mm->tab_micro_mem + *mm->entree), mm->nbre_mop * sizeof (int)); } void mm_libere (mm_st mm) { free (mm); }