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.

47 lines
827 B

8 years ago
7 years ago
8 years ago
7 years ago
8 years ago
  1. /** @file */
  2. /** @brief File description for doxygen missing. FIXME */
  3. // This file is under GNU General Public License 3.0
  4. // see LICENSE.txt
  5. #define _EXPORT_PEP_ENGINE_DLL
  6. #include "mime.h"
  7. #include <string.h>
  8. #include <stdlib.h>
  9. #include <assert.h>
  10. #include <errno.h>
  11. /**
  12. * @internal
  13. *
  14. * <!-- is_whitespace() -->
  15. *
  16. * @brief TODO
  17. *
  18. * @param[in] c char
  19. *
  20. */
  21. static bool is_whitespace(char c)
  22. {
  23. switch (c) {
  24. case ' ':
  25. case '\t':
  26. case '\r':
  27. case '\n':
  28. return true;
  29. default:
  30. return false;
  31. }
  32. }
  33. DYNAMIC_API bool is_PGP_message_text(const char *text)
  34. {
  35. if (text == NULL)
  36. return false;
  37. for (; *text && is_whitespace(*text); text++);
  38. return strncmp(text, "-----BEGIN PGP MESSAGE-----", 27) == 0;
  39. }