Comment servir des pintes de Guinness "over Internet" ;) Reprise/Fork d'un très ancien code d'un pilier de f.m.b.l : http://tnemeth.free.fr/projets/guinness-server.html
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xmem.c 560B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * xmem
  3. * architecture clients/serveur guinness : gestion memoire
  4. * Thomas Nemeth -- le 24 aout 2001
  5. *
  6. */
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <string.h>
  10. #include <strings.h>
  11. #include "xmem.h"
  12. void *xmalloc (size_t taille) {
  13. void *ret = malloc (taille);
  14. if (ret == NULL) {
  15. perror ("malloc() ");
  16. exit (-1);
  17. } else
  18. return ret;
  19. }
  20. char *xstrdup (const char *chaine) {
  21. char *ret = strdup (chaine);
  22. if (ret == NULL) {
  23. perror ("strdup() ");
  24. exit (-1);
  25. } else
  26. return ret;
  27. }