#include <stdlib.h>
#include <malloc.h>
#include <stdio.h>
#include <string.h>
Go to the source code of this file.
Data Structures | |
struct | _xmlprintOutput |
struct | _xmlprintTag |
Defines | |
#define | AMP "&" |
#define | APOS "'" |
#define | GT ">" |
#define | LT "<" |
#define | QUOT """ |
Typedefs | |
typedef _xmlprintOutput | xmlprintOutput |
typedef _xmlprintTag | xmlprintTag |
Functions | |
char * | doSpecialCharacters (char *source, int attribute) |
Returns null terminated string XML special character are now used. | |
xmlprintOutput * | xmlprint_addtag (xmlprintOutput *output, char *tag, char *attributes) |
Writes tag to stdout and add this tag to stack also. | |
void | xmlprint_addtagvalue (xmlprintOutput *output, char *value) |
Writes value to current tag. | |
void | xmlprint_closeoutput (xmlprintOutput *output) |
Closes output. | |
xmlprintOutput * | xmlprint_createoutput () |
Initializes xmlprintOutput and writes first line of XML to stdout. | |
xmlprintOutput * | xmlprint_endtag (xmlprintOutput *output) |
Ends current tag. | |
void | xmlprint_oneliner (xmlprintOutput *output, char *tag, char *attributes) |
Writes one line tag for stdout. |
#define AMP "&" |
Special character &
Definition at line 116 of file xmlprint.h.
#define APOS "'" |
Special character '
Definition at line 119 of file xmlprint.h.
#define GT ">" |
Special character >
Definition at line 118 of file xmlprint.h.
#define LT "<" |
Special character <
Definition at line 117 of file xmlprint.h.
#define QUOT """ |
Special character "
Definition at line 120 of file xmlprint.h.
typedef struct _xmlprintOutput xmlprintOutput |
Definition at line 112 of file xmlprint.h.
typedef struct _xmlprintTag xmlprintTag |
Definition at line 90 of file xmlprint.h.
char* doSpecialCharacters | ( | char * | source, | |
int | attribute | |||
) |
Returns null terminated string XML special character are now used.
This function goes through source string and changes every XML special characters into valid ones
source | char*, null terminated string | |
attribute | int, an integer. 0 change all special characters. 1 Remove all other expect " |
xmlprintOutput* xmlprint_addtag | ( | xmlprintOutput * | output, | |
char * | tag, | |||
char * | attributes | |||
) |
Writes tag to stdout and add this tag to stack also.
xmlprint_addtag writes tag to stdout and add this tag to stack also. After this function it is possible to use xmlprint_addtagvalue function.
output | xmlprintOutput*, a XML output | |
tag | char*, a XML tag as a null terminated string | |
attributes | char*, a XML tag's attributes as a null terminated string |
void xmlprint_addtagvalue | ( | xmlprintOutput * | output, | |
char * | value | |||
) |
Writes value to current tag.
xmlprint_addtagvalue writes text inside current value
output | xmlprintOutput*, a XML output | |
value | char*, a text to current tag as a null terminated string |
void xmlprint_closeoutput | ( | xmlprintOutput * | output | ) |
Closes output.
xmlprint_closeoutput calls xmlprint_endtag as long as there are no tags left to close. After this output is freed from the memory. Use this function only when there will no more tags to add.
output | xmlprintOutput*, a XML output |
xmlprintOutput* xmlprint_createoutput | ( | ) |
Initializes xmlprintOutput and writes first line of XML to stdout.
xmlprint_createoutput initializes xmlprintOutput and writes first line of xml text which is: "<?xml version="1.0"?>"
xmlprintOutput* xmlprint_endtag | ( | xmlprintOutput * | output | ) |
Ends current tag.
xmlprint_endtag ends current tag and returns xmlprintOutput with second tag from stack.
output | xmlprintOutput*, a XML output |
void xmlprint_oneliner | ( | xmlprintOutput * | output, | |
char * | tag, | |||
char * | attributes | |||
) |
Writes one line tag for stdout.
xmlprint_oneliner writes one line tag with possible attributes
output | xmlprintOutput*, a XML output | |
tag | char*, a XML tag as a null terminated string | |
attributes | char*, a XML tag's attributes as a null terminated string |