Haka: include/haka/parameters.h File Reference

Haka

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Functions
parameters.h File Reference
`#include <stddef.h>`
`#include <haka/types.h>`

Go to the source code of this file.

## Functions
struct parameters * | parameters_open (const char *file)
struct parameters * | parameters_create ()
void | parameters_free (struct parameters *params)
int | parameters_open_section (struct parameters *params, const char *section)
int | parameters_close_section (struct parameters *params)
const char * | parameters_get_string (struct parameters *params, const char *key, const char *def)
bool | parameters_get_boolean (struct parameters *params, const char *key, bool def)
int | parameters_get_integer (struct parameters *params, const char *key, int def)
bool | parameters_set_string (struct parameters *params, const char *key, const char *value)
bool | parameters_set_boolean (struct parameters *params, const char *key, bool value)
bool | parameters_set_integer (struct parameters *params, const char *key, int value)

## Detailed Description

Abstract parameters utilities.

It is mainly used to give generic parameters to modules.

## Function Documentation

int parameters_close_section | ( | struct parameters * | params | ) |

Close the section.

struct parameters* parameters_create | ( |  | ) |

Create an empty parameter list.

void parameters_free | ( | struct parameters * | params | ) |

Release a paramerter list.

bool parameters_get_boolean | ( | struct parameters * | params,
|  | const char * | key,
|  | bool | def
| ) |  |

Get the parameter value as a boolean.

int parameters_get_integer | ( | struct parameters * | params,
|  | const char * | key,
|  | int | def
| ) |  |

Get the parameter value as an integer.

const char* parameters_get_string | ( | struct parameters * | params,
|  | const char * | key,
|  | const char * | def
| ) |  |

Get the parameter value as a string.

struct parameters* parameters_open | ( | const char * | file | ) |

Opaque structures. Load the parameters from a file. The file must follow the ini file format.

int parameters_open_section | ( | struct parameters * | params,
|  | const char * | section
| ) |  |

Select a section in the parameter list.

bool parameters_set_boolean | ( | struct parameters * | params,
|  | const char * | key,
|  | bool | value
| ) |  |

Set or add a boolean parameter.

bool parameters_set_integer | ( | struct parameters * | params,
|  | const char * | key,
|  | int | value
| ) |  |

Set or add a integer parameter.

bool parameters_set_string | ( | struct parameters * | params,
|  | const char * | key,
|  | const char * | value
| ) |  |

Set or add a string parameter.