46 linhas
1015 B

  1. /*
  2. * libcucul Canvas for ultrafast compositing of Unicode letters
  3. * Copyright (c) 2002-2006 Sam Hocevar <sam@zoy.org>
  4. * All Rights Reserved
  5. *
  6. * $Id$
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the Do What The Fuck You Want To
  10. * Public License, Version 2, as published by Sam Hocevar. See
  11. * http://sam.zoy.org/wtfpl/COPYING for more details.
  12. */
  13. /*
  14. * This file contains error management functions.
  15. */
  16. #include "config.h"
  17. #include "common.h"
  18. #include "cucul.h"
  19. #include "cucul_internals.h"
  20. int cucul_errno(void)
  21. {
  22. return _cucul_errno;
  23. }
  24. char const *cucul_strerror(int error)
  25. {
  26. switch(error)
  27. {
  28. case 0:
  29. return "no error";
  30. case ECUCUL_NOMEM:
  31. return "not enough memory";
  32. case ECUCUL_INVAL:
  33. return "invalid argument";
  34. case ECUCUL_RANGE:
  35. return "argument out of bounds";
  36. default:
  37. return "unknown error";
  38. }
  39. }