Skip to content

Commit 8160979

Browse files
authored
Complete remaining todos (#7)
2 parents f8bd1e6 + 3a4652e commit 8160979

File tree

4 files changed

+42
-9
lines changed

4 files changed

+42
-9
lines changed

.github/translations/es/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,12 @@ Este repositorio contiene el trabajo práctico de la materia Tópicos de Program
4040

4141
## Características
4242

43-
- Integración continua con [GitHub Actions](https://docs.github.com/es/actions)
43+
- Convenciones y estándares de código
4444
- Documentación del código utilizando la sintaxis de [Doxygen](https://www.doxygen.nl/)
45+
- Integración continua con [GitHub Actions](https://docs.github.com/es/actions)
46+
- Memoria dinámica
47+
- Planificación de la arquitectura
48+
- Planificación del flujo de trabajo del equipo (ramas, etiquetas y versionado)
4549

4650
## Instalación
4751

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,12 @@ This repository contains the practical work for the Programming Topics course at
4040

4141
## Features
4242

43-
- Continuous integration with [GitHub Actions](https://docs.github.com/en/actions)
43+
- Architecture planning
44+
- Code conventions and standards
4445
- Code documentation using [Doxygen](https://www.doxygen.nl/) syntax
46+
- Continuous integration with [GitHub Actions](https://docs.github.com/en/actions)
47+
- Dynamic memory
48+
- Team Workflow planning (branches, tags, and releases)
4549

4650
## Installation
4751

libs/utilities.h

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,20 @@
77
#include "./macros.h"
88
#include "./patterns/main.h"
99

10-
// TODO: Documentation
10+
/**
11+
* @brief Frees the memory allocated for a 2D array.
12+
*
13+
* This function deallocates the memory used by a 2D array of characters. It iterates through each
14+
* row, frees the memory allocated for each row, and then frees the memory allocated for the array
15+
* of row pointers.
16+
*
17+
* @param arr 2D array to be destroyed.
18+
* @param rows Number of rows in the 2D array.
19+
* @param cols Number of columns in the 2D array.
20+
*
21+
* @warning Ensure that the array has been dynamically allocated and that the number of rows and
22+
* columns are correctly specified to avoid undefined behavior.
23+
*/
1124
void destroy2DArray(char** arr, int rows, int cols);
1225

1326
/**
@@ -24,7 +37,10 @@ void destroy2DArray(char** arr, int rows, int cols);
2437
* string as input and returns an integer. The validator function should return
2538
* 1 if the input is valid, and 0 otherwise.
2639
*
27-
* @return A pointer to the string entered by the user.
40+
* @return A pointer to the string entered by the user dynamically allocated in memory.
41+
*
42+
* @warning Ensure to free the returned pointer after use with the appropriate deallocation
43+
* functions to avoid memory leaks.
2844
*/
2945
char* getUserInputStr(char* message, char* onInvalidMessage, int strLength,
3046
int (*validator)(char* userInput));
@@ -42,7 +58,20 @@ char* getUserInputStr(char* message, char* onInvalidMessage, int strLength,
4258
*/
4359
int isStrIn(char* str, char* arr[], int arrLength);
4460

45-
// TODO: Documentation
61+
/**
62+
* @brief Initializes a 2D array of characters.
63+
*
64+
* This function dynamically allocates memory for a 2D array of characters with the specified number
65+
* of rows and columns.
66+
*
67+
* @param rows Number of rows.
68+
* @param cols Number of columns.
69+
*
70+
* @return A pointer to the 2D array of characters.
71+
*
72+
* @warning Ensure to free the allocated memory using appropriate deallocation functions to avoid
73+
* memory leaks.
74+
*/
4675
char** new2DArray(int rows, int cols);
4776

4877
/**

todo.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)