info.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License 2.0 (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #include <stddef.h>
  10. #include <openssl/crypto.h>
  11. #include "internal/dso_conf.h"
  12. #include "e_os.h"
  13. const char *OPENSSL_info(int t)
  14. {
  15. switch (t) {
  16. case OPENSSL_INFO_CONFIG_DIR:
  17. return OPENSSLDIR;
  18. case OPENSSL_INFO_ENGINES_DIR:
  19. return ENGINESDIR;
  20. case OPENSSL_INFO_MODULES_DIR:
  21. return MODULESDIR;
  22. case OPENSSL_INFO_DSO_EXTENSION:
  23. return DSO_EXTENSION;
  24. case OPENSSL_INFO_DIR_FILENAME_SEPARATOR:
  25. #if defined(_WIN32)
  26. return "\\";
  27. #elif defined(__VMS)
  28. return "";
  29. #else /* Assume POSIX */
  30. return "/";
  31. #endif
  32. case OPENSSL_INFO_LIST_SEPARATOR:
  33. {
  34. static const char list_sep[] = { LIST_SEPARATOR_CHAR, '\0' };
  35. return list_sep;
  36. }
  37. default:
  38. break;
  39. }
  40. /* Not an error */
  41. return NULL;
  42. }