ap_provider.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* Licensed to the Apache Software Foundation (ASF) under one or more
  2. * contributor license agreements. See the NOTICE file distributed with
  3. * this work for additional information regarding copyright ownership.
  4. * The ASF licenses this file to You under the Apache License, Version 2.0
  5. * (the "License"); you may not use this file except in compliance with
  6. * the License. You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /**
  17. * @file ap_provider.h
  18. * @brief Apache Provider API
  19. *
  20. * @defgroup APACHE_CORE_PROVIDER Provider API
  21. * @ingroup APACHE_CORE
  22. * @{
  23. */
  24. #ifndef AP_PROVIDER_H
  25. #define AP_PROVIDER_H
  26. #include "ap_config.h"
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. typedef struct {
  31. const char *provider_name;
  32. } ap_list_provider_names_t;
  33. typedef struct {
  34. const char *provider_group;
  35. const char *provider_version;
  36. } ap_list_provider_groups_t;
  37. /**
  38. * This function is used to register a provider with the global
  39. * provider pool.
  40. * @param pool The pool to create any storage from
  41. * @param provider_group The group to store the provider in
  42. * @param provider_name The name for this provider
  43. * @param provider_version The version for this provider
  44. * @param provider Opaque structure for this provider
  45. * @return APR_SUCCESS if all went well
  46. */
  47. AP_DECLARE(apr_status_t) ap_register_provider(apr_pool_t *pool,
  48. const char *provider_group,
  49. const char *provider_name,
  50. const char *provider_version,
  51. const void *provider);
  52. /**
  53. * This function is used to retrieve a provider from the global
  54. * provider pool.
  55. * @param provider_group The group to look for this provider in
  56. * @param provider_name The name for the provider
  57. * @param provider_version The version for the provider
  58. * @return provider pointer to provider if found, NULL otherwise
  59. */
  60. AP_DECLARE(void *) ap_lookup_provider(const char *provider_group,
  61. const char *provider_name,
  62. const char *provider_version);
  63. /**
  64. * This function is used to retrieve a list (array) of provider
  65. * names from the specified group with the specified version.
  66. * @param pool The pool to create any storage from
  67. * @param provider_group The group to look for this provider in
  68. * @param provider_version The version for the provider
  69. * @return pointer to array of ap_list_provider_names_t of provider names (could be empty)
  70. */
  71. AP_DECLARE(apr_array_header_t *) ap_list_provider_names(apr_pool_t *pool,
  72. const char *provider_group,
  73. const char *provider_version);
  74. /**
  75. * This function is used to retrieve a list (array) of provider groups and versions
  76. * @param pool The pool to create any storage from
  77. * @return pointer to array of ap_list_provider_groups_t of provider groups
  78. * and versions (could be empty)
  79. */
  80. AP_DECLARE(apr_array_header_t *) ap_list_provider_groups(apr_pool_t *pool);
  81. #ifdef __cplusplus
  82. }
  83. #endif
  84. #endif
  85. /** @} */