Coding style

This commit is contained in:
AnonymusRaccoon
2020-03-12 18:31:11 +01:00
parent 91f3604772
commit edee81e3ae
3 changed files with 23 additions and 20 deletions
+8 -5
View File
@@ -1,11 +1,14 @@
//
// Created by anonymus-raccoon on 3/2/20.
//
/*
** EPITECH PROJECT, 2020
** My3D
** File description:
** otherget
*/
#include "xml.h"
char *xml_gettmpstring(node *n, const char *key, char *def)
{
char *ret = xml_gettempprop(n, key);
return ret ? ret : def;
char *ret = xml_gettempprop(n, key);
return ret ? ret : def;
}
+12 -12
View File
@@ -42,22 +42,22 @@ bool xml_hasproperty(node *n, const char *key)
bool xml_propcontains(node *n, const char *key, const char *tofind)
{
char *tmp = xml_gettempprop(n, key);
char *tmp = xml_gettempprop(n, key);
return tmp && my_strstr(tmp, tofind);
return tmp && my_strstr(tmp, tofind);
}
bool xml_getbool(node *n, const char *key, bool default_value)
{
char *tmp = xml_gettempprop(n, key);
char *tmp = xml_gettempprop(n, key);
if (tmp && !my_strcmp(tmp, "true"))
return (true);
if (tmp && !my_strcmp(tmp, "True"))
return (true);
if (tmp && !my_strcmp(tmp, "false"))
return (false);
if (tmp && !my_strcmp(tmp, "False"))
return (false);
return (default_value);
if (tmp && !my_strcmp(tmp, "true"))
return (true);
if (tmp && !my_strcmp(tmp, "True"))
return (true);
if (tmp && !my_strcmp(tmp, "false"))
return (false);
if (tmp && !my_strcmp(tmp, "False"))
return (false);
return (default_value);
}
+3 -3
View File
@@ -28,9 +28,9 @@ char *xml_getproperty(node *n, const char *key)
char *prop = xml_gettempprop(n, key);
if (prop) {
my_str_replace(prop, "\\n", '\n');
return (my_strdup(prop));
}
my_str_replace(prop, "\\n", '\n');
return (my_strdup(prop));
}
return (NULL);
}