xmalloc.h 1.0 KB

1234567891011121314151617181920212223242526272829
  1. /* $Id: xmalloc.h,v 1.7 2007/02/11 20:07:31 dijkstra Exp $ */
  2. /*
  3. * Author: Tatu Ylonen <ylo@cs.hut.fi>
  4. * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
  5. * All rights reserved
  6. * Versions of malloc and friends that check their results, and never return
  7. * failure (they call fatal if they encounter an error).
  8. *
  9. * As far as I am concerned, the code I have written for this software
  10. * can be used freely for any purpose. Any derived versions of this
  11. * software must be clearly marked as such, and if the derived work is
  12. * incompatible with the protocol description in the RFC file, it must be
  13. * called by a name other than "ssh" or "Secure Shell".
  14. */
  15. #ifndef _SYMON_LIB_XMALLOC_H
  16. #define _SYMON_LIB_XMALLOC_H
  17. #include <sys/types.h>
  18. /* Like malloc and friends, but these call fatal if something breaks */
  19. __BEGIN_DECLS
  20. void *xmalloc(size_t);
  21. void *xrealloc(void *, size_t);
  22. void xfree(void *);
  23. char *xstrdup(const char *);
  24. __END_DECLS
  25. #endif /* _SYMON_LIB_XMALLOC_H */