Projet Informatique Théorique 2016
Instructions et Documentation
outils.c
1 /*
2  * Ce fichier fait partie d'un projet de programmation donné en Licence 3
3  * à l'Université de Bordeaux.
4  *
5  * Copyright (C) 2014 Adrien Boussicault
6  *
7  * This Library is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This Library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this Library. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 
22 #include "outils.h"
23 
24 #include <stdlib.h>
25 
26 int test( int result, int ligne ){
27  if( ! result ){
28  fprintf( stdout, "Echec du Test ligne %d.\n", ligne );
29  return 1;
30  }
31  return 0;
32 }
33 
34 void* xmalloc( size_t n ){
35  void* result = malloc( n );
36  if( ! result ){
37  ERREUR( "Espace insuffisant" );
38  }
39  return result;
40 }
41 
42 void xfree( void* ptr ){
43  free(ptr);
44 }