YAC 3.18.0
Yet Another Coupler
Loading...
Searching...
No Matches
param_struct.c File Reference
#include "param_struct.h"
#include "param_internal.h"
#include "utils_common.h"
#include <stdlib.h>
#include <string.h>
Include dependency graph for param_struct.c:

Go to the source code of this file.

Data Structures

struct  yac_param_struct
 

Functions

static enum yac_param_type yac_param_struct_get_type (const struct yac_param *param)
 
static int yac_param_struct_is_default (const struct yac_param *param)
 
static const char * yac_param_struct_get_name (const struct yac_param *param)
 
static int yac_param_struct_get_sub_count (const struct yac_param *param, size_t *count)
 
static int yac_param_struct_get_sub_by_name (const struct yac_param *param, const char *name, struct yac_param **sub_param)
 
static int yac_param_struct_get_sub_by_index (struct yac_param *param, size_t idx, struct yac_param **sub_param)
 
static void yac_param_struct_delete (struct yac_param *param)
 
struct yac_paramyac_param_struct_new (const char *name, struct yac_param **subparams, size_t subparam_count)
 Create a new struct parameter with a given name and subparameters.
 

Variables

static const struct yac_param_vtable yac_param_struct_vtable
 

Function Documentation

◆ yac_param_struct_delete()

static void yac_param_struct_delete ( struct yac_param * param)
static

Definition at line 98 of file param_struct.c.

Here is the call graph for this function:

◆ yac_param_struct_get_name()

static const char * yac_param_struct_get_name ( const struct yac_param * param)
static

Definition at line 36 of file param_struct.c.

◆ yac_param_struct_get_sub_by_index()

static int yac_param_struct_get_sub_by_index ( struct yac_param * param,
size_t idx,
struct yac_param ** sub_param )
static

Definition at line 81 of file param_struct.c.

◆ yac_param_struct_get_sub_by_name()

static int yac_param_struct_get_sub_by_name ( const struct yac_param * param,
const char * name,
struct yac_param ** sub_param )
static

Definition at line 54 of file param_struct.c.

Here is the call graph for this function:

◆ yac_param_struct_get_sub_count()

static int yac_param_struct_get_sub_count ( const struct yac_param * param,
size_t * count )
static

Definition at line 43 of file param_struct.c.

◆ yac_param_struct_get_type()

static enum yac_param_type yac_param_struct_get_type ( const struct yac_param * param)
static

Definition at line 19 of file param_struct.c.

◆ yac_param_struct_is_default()

static int yac_param_struct_is_default ( const struct yac_param * param)
static

Definition at line 25 of file param_struct.c.

Here is the call graph for this function:

◆ yac_param_struct_new()

struct yac_param * yac_param_struct_new ( const char * name,
struct yac_param ** subparams,
size_t subparam_count )

Create a new struct parameter with a given name and subparameters.

Allocates and returns a new struct parameter object. The struct parameter will have the specified name and contain the given subparameters as its children.

The subparams array must contain pointers to already-allocated parameter objects (e.g., created with yac_param_int_new, etc). Ownership of the subparams is transferred to the struct parameter: they will be deleted when the struct parameter is deleted.

Parameters
nameName of the struct parameter (must not be NULL or empty)
subparamsArray of pointers to subparameter objects
subparam_countNumber of subparameters in the array
Returns
Pointer to new struct parameter object

Definition at line 128 of file param_struct.c.

Here is the caller graph for this function:

Variable Documentation

◆ yac_param_struct_vtable

const struct yac_param_vtable yac_param_struct_vtable
static
Initial value:
= {
.get_sub_by_index = yac_param_struct_get_sub_by_index,
.append = NULL,
.set_scalar = NULL,
.get_scalar = NULL,
.set_scalar_int = NULL,
.set_scalar_dble = NULL,
.get_scalar_int = NULL,
.get_scalar_dble = NULL
}
static int yac_param_struct_get_sub_count(const struct yac_param *param, size_t *count)
static void yac_param_struct_delete(struct yac_param *param)
static enum yac_param_type yac_param_struct_get_type(const struct yac_param *param)
static int yac_param_struct_get_sub_by_name(const struct yac_param *param, const char *name, struct yac_param **sub_param)
static int yac_param_struct_is_default(const struct yac_param *param)
static const char * yac_param_struct_get_name(const struct yac_param *param)
static int yac_param_struct_get_sub_by_index(struct yac_param *param, size_t idx, struct yac_param **sub_param)

Definition at line 111 of file param_struct.c.