research what is going on with mxml_node_t

This commit is contained in:
Joshua Peisach 2024-05-22 14:17:55 -04:00
parent db85bd1fa7
commit 31da4b82ba
No known key found for this signature in database
GPG Key ID: 41C3D4189AFEDB5A
2 changed files with 28 additions and 8 deletions

View File

@ -32,23 +32,26 @@ static inline char *_xmldup(const char *str) {
return pstrdup(str);
}
static char *_get_cdata(mxml_node_t *node) {
static char *_get_cdata(struct mxml_node_t *node) {
if (!node)
return NULL;
// mxml_node_t *n = node->child;
/*
'invalid use of incomplete typedef 'mxml_node_t'
*/
struct mxml_node_t *n = *node->child;
// while (n) {
// if (n->type == MXML_OPAQUE)
// return n->value.opaque;
while (n) {
if (n->type == MXML_OPAQUE)
return n->value.opaque;
// n = mxmlWalkNext(n, node, MXML_NO_DESCEND);
// }
n = mxmlWalkNext(n, node, MXML_NO_DESCEND);
}
return NULL;
}
static char *_get_elem_cdata(mxml_node_t *node, const char *element) {
static char *_get_elem_cdata(mxml_node_t **node, const char *element) {
if (!node)
return NULL;

View File

@ -1,12 +1,29 @@
#ifndef _XML_H_
#define _XML_H_
#include <time.h>
#include <gctypes.h>
#include "font.h"
/*
* struct mxml_node_s /**** An XML node. @private@ ****/
// {
// mxml_type_t type; /* Node type */
// struct mxml_node_s *next; /* Next node under same parent */
// struct mxml_node_s *prev; /* Previous node under same parent */
// struct mxml_node_s *parent; /* Parent node */
// struct mxml_node_s *child; /* First child node */
// struct mxml_node_s *last_child; /* Last child node */
// mxml_value_t value; /* Node value */
// int ref_count; /* Use count */
// void *user_data; /* User data */
// };
#define NO_COLOR 0x0DEADF00
typedef struct {