mirror of
https://github.com/zoriya/xmlParser.git
synced 2025-12-06 02:56:10 +00:00
Adding a get string with a default value
This commit is contained in:
@@ -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
11
src/otherget.c
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user