forked from meduketto/iksemel
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from Zaryob/dev
Merge from "dev"
- Loading branch information
Showing
13 changed files
with
186 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,4 @@ extern int errno; | |
|
||
#include "finetune.h" | ||
|
||
#endif // __COMMON_H | ||
#endif // __COMMON_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,7 +102,7 @@ enum ikserror { | |
}; | ||
|
||
enum ikstagtype { | ||
IKS_OPEN, | ||
IKS_OPEN = 0, | ||
IKS_CLOSE, | ||
IKS_SINGLE | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,7 +70,7 @@ pkgconf.set('VERSION', version) | |
|
||
pkg_install_dir = '@0@/pkgconfig'.format(get_option('libdir')) | ||
|
||
configure_file(input : 'iksemel.pc.in'.format(version), | ||
configure_file(input : 'iksemel.pc.in', | ||
output : 'iksemel-@[email protected]'.format(version), | ||
configuration : pkgconf, | ||
install_dir : pkg_install_dir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,7 @@ if backends.length() != 0 | |
|
||
pkg_install_dir = '@0@/pkgconfig'.format(get_option('libdir')) | ||
|
||
configure_file(input : 'jabber.pc.in'.format(version), | ||
configure_file(input : 'jabber.pc.in', | ||
output : 'jabber-@[email protected]'.format(version), | ||
configuration : jabber_pkgconf, | ||
install_dir : pkg_install_dir) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* iksemel (XML parser for Jabber) | ||
** Copyright (C) 2000-2003 Gurer Ozen | ||
** This code is free software; you can redistribute it and/or | ||
** modify it under the terms of GNU Lesser General Public License. | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <string.h> | ||
#include <locale.h> | ||
|
||
#include "iksemel.h" | ||
|
||
int main (int argc, char *argv[]) | ||
{ | ||
setlocale (LC_ALL, ""); | ||
static char xml[] = "<test>" | ||
"<text>Hello, 世界</text>" | ||
"<emoji>💩</emoji>" | ||
"<invalid></invalid>" | ||
"<null></null>" | ||
"<twoun>Å</twoun>" | ||
"<threeun>Ā</threeun>" | ||
"<katana>セ</katana>" | ||
"<wideunicode>𦀇</wideunicode>" | ||
"<nonprint></nonprint>" | ||
"</test>"; | ||
|
||
iks *x = iks_new ("test"); | ||
iks_insert_cdata (iks_insert (x, "text"), "Hello, 世界", 13); | ||
iks_insert_cdata (iks_insert (x, "emoji"), "\U0001F4A9", 4); | ||
iks_insert_cdata (iks_insert (x, "invalid"), "\x80\x81", 2); | ||
iks_insert_cdata (iks_insert (x, "null"), "\0", 1); | ||
iks_insert_cdata (iks_insert (x, "twoun"), "Å", 3); | ||
iks_insert_cdata (iks_insert (x, "threeun"), "Ā", 3); | ||
iks_insert_cdata (iks_insert (x, "katana"), "セ", 4); | ||
iks_insert_cdata (iks_insert (x, "wideunicode"), "\U00026007", 4); | ||
iks_insert_cdata (iks_insert (x, "nonprint"), "\x1\a\v\x7F", 4); | ||
|
||
char *t = iks_string (iks_stack (x), x); | ||
if(!t || strcmp(t, xml) != 0) { | ||
printf("Result: %s\n", t); | ||
printf("Expected: %s\n", xml); | ||
return 1; | ||
} | ||
iks_delete(x); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters