|
Autopysta
|
Defines the Diccionario and Nodo structs for key-value dictionary management.
More...
Go to the source code of this file.
Classes | |
| struct | Nodo |
| Struct representing a node in the dictionary. More... | |
| struct | Diccionario |
| Struct representing the dictionary. More... | |
Typedefs | |
| typedef struct Diccionario | Diccionario |
| typedef struct Nodo | Nodo |
Functions | |
| Diccionario * | diccionario_nuevo (void) |
| Creates a new empty dictionary. | |
| void | diccionario_agrega (Diccionario *D, const char *new_name, double new_value) |
| Adds a new key-value pair to the dictionary. | |
| void | diccionario_muestra (const Diccionario *D) |
| Displays the contents of the dictionary. | |
| void | diccionario_aumenta (Diccionario **D, int unidades) |
| Increases the size of the dictionary by a given number of units. | |
| void | diccionario_libera (Diccionario *D) |
| Frees the memory allocated for the dictionary. | |
| void | diccionario_copia (const Diccionario *Do, Diccionario *Dd, int cantidad) |
| Copies the contents of one dictionary into another. | |
| void | diccionario_inicializa_contenido (Diccionario *D) |
| Initializes the contents of the dictionary. | |
| double | diccionario_busca_significado (Diccionario *D, const char *nombre) |
| Searches for the value associated with a key in the dictionary. | |
Defines the Diccionario and Nodo structs for key-value dictionary management.
This file provides the data structures and functions needed to manage a simple key-value dictionary, where each key is a string and the value is a double.
| void diccionario_agrega | ( | Diccionario * | D, |
| const char * | new_name, | ||
| double | new_value ) |
Adds a new key-value pair to the dictionary.
| D | Pointer to the dictionary where the key-value pair will be added. |
| new_name | Key for the new node to be added. |
| new_value | Value corresponding to the new key. |
| void diccionario_aumenta | ( | Diccionario ** | D, |
| int | unidades ) |
Increases the size of the dictionary by a given number of units.
| D | Pointer to the dictionary to be increased in size. |
| unidades | The number of additional nodes to allocate. |
| double diccionario_busca_significado | ( | Diccionario * | D, |
| const char * | nombre ) |
Searches for the value associated with a key in the dictionary.
| D | Pointer to the dictionary. |
| nombre | The key to search for. |
| void diccionario_copia | ( | const Diccionario * | Do, |
| Diccionario * | Dd, | ||
| int | cantidad ) |
Copies the contents of one dictionary into another.
| Do | Pointer to the original dictionary (source). |
| Dd | Pointer to the destination dictionary. |
| cantidad | The number of nodes to copy. |
| void diccionario_inicializa_contenido | ( | Diccionario * | D | ) |
Initializes the contents of the dictionary.
| D | Pointer to the dictionary whose contents will be initialized. |
| void diccionario_libera | ( | Diccionario * | D | ) |
Frees the memory allocated for the dictionary.
| D | Pointer to the dictionary to be deleted. |
| void diccionario_muestra | ( | const Diccionario * | D | ) |
Displays the contents of the dictionary.
| D | Pointer to the dictionary whose contents will be displayed. |
| Diccionario * diccionario_nuevo | ( | void | ) |
Creates a new empty dictionary.
Allocates memory for a new Diccionario and initializes it with no nodes.