xmalloc.h 977 B

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