Skip to content

Commit

Permalink
Se agregan los datos del alumno GERONIMO, Franco Ezequiel
Browse files Browse the repository at this point in the history
  • Loading branch information
Franco414 committed Apr 10, 2021
2 parents e334b29 + c0cfb71 commit 8869f2c
Show file tree
Hide file tree
Showing 4 changed files with 254 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build
/.vscode
28 changes: 27 additions & 1 deletion inc/alumnos.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,37 @@ typedef struct alumno_s {
} const * alumno_t;

/*=====[Definitions of public global variables]==============================*/

char cadena[100];
/*=====[Prototypes (declarations) of public functions]=======================*/

bool SerializarAlumno(char * cadena, size_t espacio, const alumno_t alumno);

bool FrancoGeronimo(char * cadena, size_t espacio);

bool AlejandroRougier(char * cadena, size_t espacio);

bool RodriguezOsvaldo(char * cadena, size_t espacio);

bool IvanVargasMarza(char * cadena, size_t espacio);

bool NicolasVargas(char * cadena, size_t espacio);

bool FedericoMeghinasso(char * cadena, size_t espacio);

bool MatiasMeghinasso(char * cadena, size_t espacio);

bool MartinDuarte(char * cadena, size_t espacio);

bool AlejandroPermingeat(char * cadena, size_t espacio);

bool EstebanVolentini(char * cadena, size_t espacio);

bool LucasOrsi(char * cadena, size_t espacio);

bool GermanVelardez(char * cadena, size_t espacio);

bool JoseAlvarado(char * cadena, size_t espacio);

/*=====[Prototypes (declarations) of public interrupt functions]=============*/

/*=====[C++ - end]===========================================================*/
Expand Down
154 changes: 146 additions & 8 deletions src/alumnos.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Version: 0.1.0
* Creation Date: 2019/06/21
*/

/*=====[Inclusion of own header]=============================================*/

#include "alumnos.h"
Expand All @@ -32,19 +32,21 @@

/*=====[Implementations of interrupt functions]==============================*/

bool SerializarAlumno(char * cadena, size_t espacio, const alumno_t alumno) {
bool SerializarAlumno(char *cadena, size_t espacio, const alumno_t alumno)
{
int resultado;
const char FORMATO[] = "{"
"\"documento\":\"%s\","
"\"apellidos\":\"%s\","
"\"nombres\":\"%s\""
"}";
"\"documento\":\"%s\","
"\"apellidos\":\"%s\","
"\"nombres\":\"%s\""
"}";

resultado = snprintf(cadena, espacio, FORMATO,
alumno->documento, alumno->apellidos, alumno->nombres);
resultado = snprintf(cadena, espacio, FORMATO,
alumno->documento, alumno->apellidos, alumno->nombres);

return (resultado >= 0);
}

bool FrancoGeronimo(char * cadena, size_t espacio) {
const struct alumno_s alumno = {
.apellidos = "GERONIMO",
Expand All @@ -53,4 +55,140 @@ bool FrancoGeronimo(char * cadena, size_t espacio) {
};
return SerializarAlumno(cadena, espacio, &alumno);
}

bool IvanVargasMarza(char * cadena, size_t espacio) {
const struct alumno_s alumno = {
.apellidos = "VARGAS",
.nombres = "Ivan",
.documento = "38.170.436",
};

return SerializarAlumno(cadena, espacio, &alumno);
}

bool RodriguezOsvaldo(char * cadena, size_t espacio) {
const struct alumno_s alumno = {
.apellidos = "RODRIGUEZ",
.nombres = "Osvaldo Antonio",
.documento = "15.123.345",
};

return SerializarAlumno(cadena, espacio, &alumno);
}

bool NicolasVargas(char * cadena, size_t espacio) {
const struct alumno_s alumno = {
.apellidos = "VARGAS",
.nombres = "Nicolás",
.documento = "33.154.750",
};

return SerializarAlumno(cadena, espacio, &alumno);
}

bool FedericoMeghinasso(char * cadena, size_t espacio) {
const struct alumno_s alumno = {
.apellidos = "MEGHINASSO",
.nombres = "Federico Nicolas",
.documento = "35.229.281",
};

return SerializarAlumno(cadena, espacio, &alumno);
}

bool MatiasMeghinasso(char *cadena, size_t espacio)
{
const struct alumno_s alumno = {
.apellidos = "Matias",
.nombres = "Matias Gino",
.documento = "36.806.968",
};

return SerializarAlumno(cadena, espacio, &alumno);
}

bool MartinDuarte(char * cadena, size_t espacio) {
const struct alumno_s alumno = {
.apellidos = "DUARTE",
.nombres = "Martin Nicolás",
.documento = "38.170.436",
};

return SerializarAlumno(cadena, espacio, &alumno);
}

bool AlejandroRougier(char * cadena, size_t espacio) {
const struct alumno_s alumno = {
.apellidos = "ROUGIER",
.nombres = "Omar Alejandro",
.documento = "22.661.059",
};

return SerializarAlumno(cadena, espacio, &alumno);
}

bool AlejandroPermingeat(char * cadena, size_t espacio) {
const struct alumno_s alumno = {
.apellidos = "PERMINGEAT",
.nombres = "Alejandro",
.documento = "00.000.000",
};

return SerializarAlumno(cadena, espacio, &alumno);
}

bool EstebanVolentini(char * cadena, size_t espacio) {
const struct alumno_s alumno = {
.apellidos = "VOLENTINI",
.nombres = "Esteban Daniel",
.documento = "23.517.968",
};

return SerializarAlumno(cadena, espacio, &alumno);
}

bool LucasOrsi(char * cadena, size_t espacio) {
const struct alumno_s alumno = {
.apellidos = "ORSI",
.nombres = "Lucas",
.documento = "38.492.146",
};
return SerializarAlumno(cadena, espacio, &alumno);
}


bool GermanVelardez(char * cadena, size_t espacio){
const struct alumno_s alumno = {
.apellidos = "Velardez",
.nombres = "German Gabriel",
.documento = "37165604",
};
return SerializarAlumno(cadena, espacio, &alumno);
}

bool JoseAlvarado(char * cadena, size_t espacio) {
const struct alumno_s alumno = {
.apellidos = "Alvarado",
.nombres = "Jose David",
.documento = "81.740.023",
};
return SerializarAlumno(cadena, espacio, &alumno);
}

/*=====[Implementations of private functions]================================*/


bool JosueElias(char * cadena, size_t espacio) {
const struct alumno_s alumno = {
.apellidos = "Velardez",
.nombres = "German",
.documento = "37.165.604",
};
return SerializarAlumno(cadena, espacio, &alumno);
}


/*=====[Implementations of private functions]================================*/


/*=====[Implementations of private functions]================================*/
85 changes: 80 additions & 5 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Version: 0.1.0
* Creation Date: 2019/06/21
*/

/*=====[Inclusion of own header]=============================================*/

#include "alumnos.h"
Expand Down Expand Up @@ -34,12 +34,87 @@

/*=====[Implementations of private functions]================================*/



int main(int argc, char *argv[]) {
char cadena[128];

char cadena[128];

if (FrancoGeronimo(cadena, sizeof(cadena))) {
printf("Alumno: %s\r\n", cadena);
} else {
} else {
printf("No se pudo serializar el alumno\r\n");
}
}

if (RodriguezOsvaldo(cadena, sizeof(cadena))) {
printf("Alumno: %s\r\n", cadena);
} else {
printf("No se pudo serializar el alumno\r\n");
}

if (IvanVargasMarza(cadena, sizeof(cadena))) {
printf("Alumno: %s\r\n", cadena);
} else {
printf("No se pudo serializar el alumno\r\n");
}

if (NicolasVargas(cadena, sizeof(cadena))) {
printf("Alumno: %s\r\n", cadena);
} else {
printf("No se pudo serializar el alumno\r\n");
}

if (AlejandroPermingeat(cadena, sizeof(cadena))) {
printf("Alumno: %s\r\n", cadena);
} else {
printf("No se pudo serializar el alumno\r\n");
}

if (EstebanVolentini(cadena, sizeof(cadena))) {
printf("Alumno: %s\r\n", cadena);
}
else {
printf("No se pudo serializar el alumno\r\n");
}

if (LucasOrsi(cadena, sizeof(cadena))) {
printf("Alumno: %s\r\n", cadena);
} else {
printf("No se pudo serializar el alumno\r\n");
}

if (MartinDuarte(cadena, sizeof(cadena))) {
printf("Alumno: %s\r\n", cadena);
} else {
printf("No se pudo serializar el alumno\r\n");
}

if (MatiasMeghinasso(cadena, sizeof(cadena)))
{
printf("Alumno: %s\r\n", cadena);
}
else
{
printf("No se pudo serializar el alumno\r\n");
}

if (FedericoMeghinasso(cadena, sizeof(cadena)))
{
printf("Alumno: %s\r\n", cadena);
}
else
{
printf("No se pudo serializar el alumno\r\n");
}

if (JoseAlvarado(cadena, sizeof(cadena)))
{
printf("Alumno: %s\r\n", cadena);
}
else
{
printf("No se pudo serializar el alumno\r\n");
}

return 0;
}
}

0 comments on commit 8869f2c

Please sign in to comment.