You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2011/12/30 11:55:00 UTC
svn commit: r1225798 - in /httpd/httpd/trunk: include/ap_mmn.h
include/ap_provider.h server/provider.c
Author: sf
Date: Fri Dec 30 10:55:00 2011
New Revision: 1225798
URL: http://svn.apache.org/viewvc?rev=1225798&view=rev
Log:
Add new ap_list_provider_groups() API for mod_info
Modified:
httpd/httpd/trunk/include/ap_mmn.h
httpd/httpd/trunk/include/ap_provider.h
httpd/httpd/trunk/server/provider.c
Modified: httpd/httpd/trunk/include/ap_mmn.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/ap_mmn.h?rev=1225798&r1=1225797&r2=1225798&view=diff
==============================================================================
--- httpd/httpd/trunk/include/ap_mmn.h (original)
+++ httpd/httpd/trunk/include/ap_mmn.h Fri Dec 30 10:55:00 2011
@@ -382,6 +382,7 @@
* ap_proxy_sec2hex(), ap_proxy_make_fake_req(),
* ap_proxy_strmatch_path, ap_proxy_strmatch_domain,
* ap_proxy_table_unmerge(), proxy_lb_workers.
+ * 20111203.1 (2.5.0-dev) Add ap_list_provider_groups()
*/
#define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
@@ -389,7 +390,7 @@
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20111203
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 0 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 1 /* 0...n */
/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
Modified: httpd/httpd/trunk/include/ap_provider.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/ap_provider.h?rev=1225798&r1=1225797&r2=1225798&view=diff
==============================================================================
--- httpd/httpd/trunk/include/ap_provider.h (original)
+++ httpd/httpd/trunk/include/ap_provider.h Fri Dec 30 10:55:00 2011
@@ -36,6 +36,10 @@ typedef struct {
const char *provider_name;
} ap_list_provider_names_t;
+typedef struct {
+ const char *provider_group;
+ const char *provider_version;
+} ap_list_provider_groups_t;
/**
* This function is used to register a provider with the global
@@ -78,6 +82,16 @@ AP_DECLARE(apr_array_header_t *) ap_list
const char *provider_group,
const char *provider_version);
+/**
+ * This function is used to retrieve a list (array) of provider groups and versions
+ * @param pool The pool to create any storage from
+ * @return pointer to array of ap_list_provider_groups_t of provider groups
+ * and versions (could be empty)
+ */
+
+AP_DECLARE(apr_array_header_t *) ap_list_provider_groups(apr_pool_t *pool);
+
+
#ifdef __cplusplus
}
#endif
Modified: httpd/httpd/trunk/server/provider.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/provider.c?rev=1225798&r1=1225797&r2=1225798&view=diff
==============================================================================
--- httpd/httpd/trunk/server/provider.c (original)
+++ httpd/httpd/trunk/server/provider.c Fri Dec 30 10:55:00 2011
@@ -163,3 +163,35 @@ AP_DECLARE(apr_array_header_t *) ap_list
}
return ret;
}
+
+AP_DECLARE(apr_array_header_t *) ap_list_provider_groups(apr_pool_t *pool)
+{
+ apr_array_header_t *ret = apr_array_make(pool, 10, sizeof(ap_list_provider_groups_t));
+ ap_list_provider_groups_t *entry;
+ apr_hash_t *provider_group_hash;
+ apr_hash_index_t *groups_hi, *vers_hi;
+ char *group, *version;
+
+ if (global_providers_names == NULL)
+ return ret;
+
+ for (groups_hi = apr_hash_first(pool, global_providers_names);
+ groups_hi;
+ groups_hi = apr_hash_next(groups_hi))
+ {
+ apr_hash_this(groups_hi, (void *)&group, NULL, (void *)&provider_group_hash);
+ if (provider_group_hash == NULL)
+ continue;
+ for (vers_hi = apr_hash_first(pool, provider_group_hash);
+ vers_hi;
+ vers_hi = apr_hash_next(vers_hi))
+ {
+ apr_hash_this(vers_hi, (void *)&version, NULL, NULL);
+
+ entry = apr_array_push(ret);
+ entry->provider_group = group;
+ entry->provider_version = version;
+ }
+ }
+ return ret;
+}