|
| 1 | +/* |
| 2 | + * |
| 3 | + * Copyright (C) 2024-2025 Intel Corporation |
| 4 | + * |
| 5 | + * Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT. |
| 6 | + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 7 | + * |
| 8 | + */ |
| 9 | + |
| 10 | +#ifndef UMF_CTL_H |
| 11 | +#define UMF_CTL_H 1 |
| 12 | + |
| 13 | +#include <umf/base.h> |
| 14 | + |
| 15 | +#ifdef __cplusplus |
| 16 | +extern "C" { |
| 17 | +#endif |
| 18 | + |
| 19 | +/// |
| 20 | +/// @brief Get value of a specified attribute at the given name. |
| 21 | +/// @param name name of an attribute to be retrieved |
| 22 | +/// @param ctx pointer to the pool or the provider |
| 23 | +/// @param arg [out] pointer to the variable where the value will be stored |
| 24 | +/// @param size size of the value, depends on the context |
| 25 | +/// @return UMF_RESULT_SUCCESS on success or UMF_RESULT_ERROR_UNKNOWN on failure. |
| 26 | +/// |
| 27 | +umf_result_t umfCtlGet(const char *name, void *ctx, void *arg, size_t size); |
| 28 | + |
| 29 | +/// |
| 30 | +/// @brief Set value of a specified attribute at the given name. |
| 31 | +/// @param name name of an attribute to be set |
| 32 | +/// @param ctx pointer to the pool or the provider, NULL for the 'default' path |
| 33 | +/// @param arg [in] pointer to the value that will be set |
| 34 | +/// @param size [in] size of the value, depends on the context |
| 35 | +/// @return UMF_RESULT_SUCCESS on success or UMF_RESULT_ERROR_UNKNOWN on failure. |
| 36 | +/// |
| 37 | +umf_result_t umfCtlSet(const char *name, void *ctx, void *arg, size_t size); |
| 38 | + |
| 39 | +/// |
| 40 | +/// @brief Execute callback related with the specified attribute. |
| 41 | +/// @param name name of an attribute to be executed |
| 42 | +/// @param ctx pointer to the pool or the provider |
| 43 | +/// @param arg [in/out] pointer to the value, can be used as an input or output |
| 44 | +/// @param size [in] size of the value, depends on the context |
| 45 | +/// @return UMF_RESULT_SUCCESS on success or UMF_RESULT_ERROR_UNKNOWN on failure. |
| 46 | +/// |
| 47 | +umf_result_t umfCtlExec(const char *name, void *ctx, void *arg, size_t size); |
| 48 | + |
| 49 | +#ifdef __cplusplus |
| 50 | +} |
| 51 | +#endif |
| 52 | + |
| 53 | +#endif /* UMF_CTL_H */ |
0 commit comments