mirror of
https://github.com/labwc/labwc.git
synced 2025-11-01 22:58:47 -04:00
src/config/rcxml.c: parse xml from buffer
Avoid unit tests writing to/from files by using xmlParseMemory() instead of xmlReadFile().
This commit is contained in:
parent
40c0b169ef
commit
bc51e0ad2f
10 changed files with 86 additions and 9 deletions
23
include/buf.h
Normal file
23
include/buf.h
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* Very simple C buffer implementation
|
||||
*
|
||||
* Copyright Johan Malm 2020
|
||||
*/
|
||||
|
||||
#ifndef BUF_H
|
||||
#define BUF_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
struct buf {
|
||||
char *buf;
|
||||
int alloc;
|
||||
int len;
|
||||
};
|
||||
|
||||
void buf_init(struct buf *s);
|
||||
void buf_add(struct buf *s, const char *data);
|
||||
|
||||
#endif /* BUF_H */
|
||||
|
|
@ -4,6 +4,8 @@
|
|||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "buf.h"
|
||||
|
||||
struct rcxml {
|
||||
bool client_side_decorations;
|
||||
};
|
||||
|
|
@ -11,6 +13,7 @@ struct rcxml {
|
|||
extern struct rcxml rc;
|
||||
|
||||
void rcxml_init(struct rcxml *rc);
|
||||
void rcxml_parse_xml(struct buf *b);
|
||||
void rcxml_read(const char *filename);
|
||||
void rcxml_set_verbose(void);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue