MCPcopy Create free account
hub / github.com/apache/httpd / ap_register_provider

Function ap_register_provider

server/provider.c:35–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35AP_DECLARE(apr_status_t) ap_register_provider(apr_pool_t *pool,
36 const char *provider_group,
37 const char *provider_name,
38 const char *provider_version,
39 const void *provider)
40{
41 apr_hash_t *provider_group_hash, *provider_version_hash;
42
43 if (global_providers == NULL) {
44 global_providers = apr_hash_make(pool);
45 global_providers_names = apr_hash_make(pool);
46 apr_pool_cleanup_register(pool, NULL, cleanup_global_providers,
47 apr_pool_cleanup_null);
48 }
49
50 /* First, deal with storing the provider away */
51 provider_group_hash = apr_hash_get(global_providers, provider_group,
52 APR_HASH_KEY_STRING);
53
54 if (!provider_group_hash) {
55 provider_group_hash = apr_hash_make(pool);
56 apr_hash_set(global_providers, provider_group, APR_HASH_KEY_STRING,
57 provider_group_hash);
58 }
59
60 provider_version_hash = apr_hash_get(provider_group_hash, provider_name,
61 APR_HASH_KEY_STRING);
62
63 if (!provider_version_hash) {
64 provider_version_hash = apr_hash_make(pool);
65 apr_hash_set(provider_group_hash, provider_name, APR_HASH_KEY_STRING,
66 provider_version_hash);
67 }
68
69 /* just set it. no biggy if it was there before. */
70 apr_hash_set(provider_version_hash, provider_version, APR_HASH_KEY_STRING,
71 provider);
72
73 /* Now, tuck away the provider names in an easy-to-get format */
74 provider_group_hash = apr_hash_get(global_providers_names, provider_group,
75 APR_HASH_KEY_STRING);
76
77 if (!provider_group_hash) {
78 provider_group_hash = apr_hash_make(pool);
79 apr_hash_set(global_providers_names, provider_group, APR_HASH_KEY_STRING,
80 provider_group_hash);
81 }
82
83 provider_version_hash = apr_hash_get(provider_group_hash, provider_version,
84 APR_HASH_KEY_STRING);
85
86 if (!provider_version_hash) {
87 provider_version_hash = apr_hash_make(pool);
88 apr_hash_set(provider_group_hash, provider_version, APR_HASH_KEY_STRING,
89 provider_version_hash);
90 }
91
92 /* just set it. no biggy if it was there before. */

Callers 15

register_hooksFunction · 0.85
disk_cache_register_hookFunction · 0.85
register_hooksFunction · 0.85
register_hooksFunction · 0.85
register_hooksFunction · 0.85
register_hooksFunction · 0.85
dav_register_providerFunction · 0.85
register_hooksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected