YAC 3.21.0
Yet Another Coupler
Loading...
Searching...
No Matches
param_enum.h File Reference
#include "param_internal.h"
#include "utils_common.h"
#include <stddef.h>
Include dependency graph for param_enum.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

struct yac_param * yac_param_enum_new (const char *name, int *value_ptr, int default_value, struct yac_name_type_pair const *enum_table, size_t enum_table_size, int has_default, int is_defined)
 Create a new enum parameter for configuration.
 

Function Documentation

◆ yac_param_enum_new()

struct yac_param * yac_param_enum_new ( const char * name,
int * value_ptr,
int default_value,
struct yac_name_type_pair const * enum_table,
size_t enum_table_size,
int has_default,
int is_defined )

Create a new enum parameter for configuration.

This parameter type allows selection from a fixed set of named integer values (enums).

Special handling:

  • String-based getters/setters operate using the enum name (e.g., "conservative").
  • Int-based getters/setters operate using the enum integer value.
  • Conversion between string and int is handled internally using the provided enum_table.
  • Invalid names or values will result in an error.
Parameters
nameName of the parameter (must not be NULL or empty)
value_ptrPointer to the integer value to be set/read
default_valueDefault enum value (must be present in enum_table, ignored if has_default is false)
enum_tableArray of name/type pairs defining the enum
enum_table_sizeNumber of entries in enum_table (must be > 0)
has_defaultIf true, parameter has a default value; if false, value is undefined until set
is_definedIf true, initial value is considered defined; if false, initial value is considered undefined and user must set it before getting
Returns
New parameter handle

Definition at line 148 of file param_enum.c.

Here is the call graph for this function:
Here is the caller graph for this function: