Skip to content

Commit 88c4cf6

Browse files
committed
change ctl api to support wildcards in name parameter
1 parent 604a4fe commit 88c4cf6

22 files changed

+732
-409
lines changed

include/umf/base.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ typedef enum umf_ctl_query_type {
5656
CTL_QUERY_READ,
5757
CTL_QUERY_WRITE,
5858
CTL_QUERY_RUNNABLE,
59-
CTL_QUERY_SUBTREE,
60-
61-
MAX_CTL_QUERY_TYPE
6259
} umf_ctl_query_type_t;
6360

6461
#ifdef __cplusplus

include/umf/experimental/ctl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ extern "C" {
2424
/// @param size size of the value, depends on the context
2525
/// @return UMF_RESULT_SUCCESS on success or UMF_RESULT_ERROR_UNKNOWN on failure.
2626
///
27-
umf_result_t umfCtlGet(const char *name, void *ctx, void *arg, size_t size);
27+
umf_result_t umfCtlGet(const char *name, void *arg, size_t size, ...);
2828

2929
///
3030
/// @brief Set value of a specified attribute at the given name.
@@ -34,7 +34,7 @@ umf_result_t umfCtlGet(const char *name, void *ctx, void *arg, size_t size);
3434
/// @param size [in] size of the value, depends on the context
3535
/// @return UMF_RESULT_SUCCESS on success or UMF_RESULT_ERROR_UNKNOWN on failure.
3636
///
37-
umf_result_t umfCtlSet(const char *name, void *ctx, void *arg, size_t size);
37+
umf_result_t umfCtlSet(const char *name, void *arg, size_t size, ...);
3838

3939
///
4040
/// @brief Execute callback related with the specified attribute.
@@ -44,7 +44,7 @@ umf_result_t umfCtlSet(const char *name, void *ctx, void *arg, size_t size);
4444
/// @param size [in] size of the value, depends on the context
4545
/// @return UMF_RESULT_SUCCESS on success or UMF_RESULT_ERROR_UNKNOWN on failure.
4646
///
47-
umf_result_t umfCtlExec(const char *name, void *ctx, void *arg, size_t size);
47+
umf_result_t umfCtlExec(const char *name, void *arg, size_t size, ...);
4848

4949
#ifdef __cplusplus
5050
}

include/umf/memory_pool_ops.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#include <umf/base.h>
1414
#include <umf/memory_provider.h>
1515

16+
#include <stdarg.h>
17+
1618
#ifdef __cplusplus
1719
extern "C" {
1820
#endif
@@ -158,12 +160,13 @@ typedef struct umf_memory_pool_ops_t {
158160
/// @param arg argument for the operation.
159161
/// @param size size of the argument [optional - check name requirements]
160162
/// @param queryType type of the query to be performed.
163+
/// @param args variable arguments for the operation.
161164
///
162165
/// @return umf_result_t result of the control operation.
163166
///
164167
umf_result_t (*ext_ctl)(void *hPool, int operationType, const char *name,
165168
void *arg, size_t size,
166-
umf_ctl_query_type_t queryType);
169+
umf_ctl_query_type_t queryType, va_list args);
167170

168171
} umf_memory_pool_ops_t;
169172

include/umf/memory_provider_ops.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#ifndef UMF_MEMORY_PROVIDER_OPS_H
1111
#define UMF_MEMORY_PROVIDER_OPS_H 1
1212

13+
#include <stdarg.h>
14+
1315
#include <umf/base.h>
1416

1517
#ifdef __cplusplus
@@ -268,12 +270,13 @@ typedef struct umf_memory_provider_ops_t {
268270
/// @param arg argument for the operation.
269271
/// @param size size of the argument [optional - check name requirements]
270272
/// @param queryType type of the query to be performed.
273+
/// @param args variable arguments for the operation.
271274
///
272275
/// @return umf_result_t result of the control operation.
273276
///
274277
umf_result_t (*ext_ctl)(void *provider, int operationType, const char *name,
275278
void *arg, size_t size,
276-
umf_ctl_query_type_t queryType);
279+
umf_ctl_query_type_t queryType, va_list args);
277280

278281
} umf_memory_provider_ops_t;
279282

0 commit comments

Comments
 (0)