deprecated.h 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Copyright (c) 2013 Red Hat Inc.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. *
  8. * * Redistributions of source code must retain the above
  9. * copyright notice, this list of conditions and the
  10. * following disclaimer.
  11. * * Redistributions in binary form must reproduce the
  12. * above copyright notice, this list of conditions and
  13. * the following disclaimer in the documentation and/or
  14. * other materials provided with the distribution.
  15. * * The names of contributors to this software may not be
  16. * used to endorse or promote products derived from this
  17. * software without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  20. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  22. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  23. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  24. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  25. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  26. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  27. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  28. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  29. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  30. * DAMAGE.
  31. *
  32. * Author: Stef Walter <stefw@redhat.com>
  33. */
  34. #ifndef __P11_KIT_DEPRECATED_H__
  35. #define __P11_KIT_DEPRECATED_H__
  36. #ifndef __P11_KIT_H__
  37. #error "Please include <p11-kit/p11-kit.h> instead of this file."
  38. #endif
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42. #ifndef P11_KIT_NO_DEPRECATIONS
  43. #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
  44. #define P11_KIT_DEPRECATED_FOR(f) __attribute__((deprecated("Use " #f " instead")))
  45. #elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
  46. #define P11_KIT_DEPRECATED_FOR(f) __attribute__((__deprecated__))
  47. #endif
  48. #endif
  49. #ifndef P11_KIT_DEPRECATED_FOR
  50. #define P11_KIT_DEPRECATED_FOR(f)
  51. #endif
  52. #ifndef P11_KIT_DISABLE_DEPRECATED
  53. P11_KIT_DEPRECATED_FOR (p11_kit_modules_load)
  54. CK_RV p11_kit_initialize_registered (void);
  55. P11_KIT_DEPRECATED_FOR (p11_kit_modules_release)
  56. CK_RV p11_kit_finalize_registered (void);
  57. P11_KIT_DEPRECATED_FOR (p11_kit_modules_release)
  58. CK_FUNCTION_LIST_PTR * p11_kit_registered_modules (void);
  59. P11_KIT_DEPRECATED_FOR (p11_kit_module_for_name)
  60. CK_FUNCTION_LIST_PTR p11_kit_registered_name_to_module (const char *name);
  61. P11_KIT_DEPRECATED_FOR (p11_kit_module_get_name)
  62. char * p11_kit_registered_module_to_name (CK_FUNCTION_LIST_PTR module);
  63. P11_KIT_DEPRECATED_FOR (p11_kit_config_option)
  64. char * p11_kit_registered_option (CK_FUNCTION_LIST_PTR module,
  65. const char *field);
  66. P11_KIT_DEPRECATED_FOR (module->C_Initialize)
  67. CK_RV p11_kit_initialize_module (CK_FUNCTION_LIST_PTR module);
  68. P11_KIT_DEPRECATED_FOR (module->C_Finalize)
  69. CK_RV p11_kit_finalize_module (CK_FUNCTION_LIST_PTR module);
  70. P11_KIT_DEPRECATED_FOR (p11_kit_module_load)
  71. CK_RV p11_kit_load_initialize_module (const char *module_path,
  72. CK_FUNCTION_LIST_PTR *module);
  73. #endif /* P11_KIT_DISABLE_DEPRECATED */
  74. #undef P11_KIT_DEPRECATED_FOR
  75. #ifdef __cplusplus
  76. } /* extern "C" */
  77. #endif
  78. #endif /* __P11_KIT_DEPRECATED_H__ */