Adding a get string with a default value

This commit is contained in:
AnonymusRaccoon
2020-03-02 14:17:04 +01:00
parent af45600abf
commit 04f3ca258c
2 changed files with 12 additions and 0 deletions

View File

@@ -42,4 +42,5 @@ float xml_getfloatprop(node *n, const char *key);
int xml_getchildcount(node *n);
int xml_getchildcount_filtered(node *n, char *name);
bool xml_getbool(node *n, const char *key, bool default_value);
char *xml_gettmpstring(node *n, const char *key, char *def);
void xml_destroy(node *n);

11
src/otherget.c Normal file
View File

@@ -0,0 +1,11 @@
//
// Created by anonymus-raccoon on 3/2/20.
//
#include "xml.h"
char *xml_gettmpstring(node *n, const char *key, char *def)
{
char *ret = xml_gettempprop(n, key);
return ret ? ret : def;
}