ObjFW  Diff

Differences From Artifact [6869b6a153]:

To Artifact [1d8b135f8c]:


24
25
26
27
28
29
30





























31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46



















47
48
49
50
51
52
53
54
55
56
 * \return The escaped C string.
 *	   You need to free it manually!
 */
+ (char*)escapeCString: (const char*)s;

/**
 * Creates an XML stanza.





























 *
 * \param name The name of the tag as a C string
 * \param close A boolean whether the tag should be closed
 * \param data Data that should be inside the tag as a C string.
 *	  It will NOT be escaped, so you can also include other stanzas.
 * \param ... Field / value pairs for the tag in the form "field", "value" as
 *	  C strings.
 *	  Last element must be NULL.
 *	  Example: "field1", "value1", "field2", "value2", NULL
 * \return The created XML stanza as a C string.
 *	   You need to free it manually!
 */
+ (char*)createStanza: (const char*)name
	 withCloseTag: (BOOL)close
	      andData: (const char*)data, ...;




















/**
 * Concats an array of C strings into one C string and frees the array of C
 * strings.
 *
 * \param strs An array of C strings
 * \return The concatenated C strings.
 *	   You need to free it manually!
 */
+ (char*)concatAndFreeCStrings: (char**)strs;
@end







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
















>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>










24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
 * \return The escaped C string.
 *	   You need to free it manually!
 */
+ (char*)escapeCString: (const char*)s;

/**
 * Creates an XML stanza.
 *
 * \param name The name of the tag as a C string
 * \param ... Field / value pairs for the tag in the form "field", "value" as
 *	  C strings.
 *	  Last element must be NULL.
 *	  Example: "field1", "value1", "field2", "value2", NULL
 * \return The created XML stanza as a C string.
 *	   You need to free it manually!
 */
+ (char*)createStanza: (const char*)name, ...;

/**
 * Creates an XML stanza.
 *
 * \param name The name of the tag as a C string
 * \param data Data that should be inside the tag as a C string.
 *	  It will NOT be escaped, so you can also include other stanzas.
 * \param ... Field / value pairs for the tag in the form "field", "value" as
 *	  C strings.
 *	  Last element must be NULL.
 *	  Example: "field1", "value1", "field2", "value2", NULL
 * \return The created XML stanza as a C string.
 *	   You need to free it manually!
 */
+ (char*)createStanza: (const char*)name
	     withData: (const char*)data, ...;

/**
 * Creates an XML stanza.
 *
 * \param name The name of the tag as a C string
 * \param close A boolean whether the tag should be closed
 * \param data Data that should be inside the tag as a C string.
 *	  It will NOT be escaped, so you can also include other stanzas.
 * \param ... Field / value pairs for the tag in the form "field", "value" as
 *	  C strings.
 *	  Last element must be NULL.
 *	  Example: "field1", "value1", "field2", "value2", NULL
 * \return The created XML stanza as a C string.
 *	   You need to free it manually!
 */
+ (char*)createStanza: (const char*)name
	 withCloseTag: (BOOL)close
	      andData: (const char*)data, ...;

/**
 * Creates an XML stanza.
 *
 * \param name The name of the tag as a C string
 * \param close A boolean whether the tag should be closed
 * \param attrs Field / value pairs for the tag in the form "field", "value" as
 *	  C strings inside a va_list.
 *	  Last element must be NULL.
 *	  Example: "field1", "value1", "field2", "value2", NULL in a va_list
 * \param data Data that should be inside the tag as a C string.
 *	  It will NOT be escaped, so you can also include other stanzas.
 * \return The created XML stanza as a C string.
 *	   You need to free it manually!
 */
+ (char*)createStanza: (const char*)name
	 withCloseTag: (BOOL)close
	andAttributes: (va_list)attrs
	      andData: (const char*)data;

/**
 * Concats an array of C strings into one C string and frees the array of C
 * strings.
 *
 * \param strs An array of C strings
 * \return The concatenated C strings.
 *	   You need to free it manually!
 */
+ (char*)concatAndFreeCStrings: (char**)strs;
@end