Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add a debug option printing all the fields within the parsed URI stru…

…cture

* testURI.c: add a debug option printing all the fields within
  the parsed URI structure
Daniel

svn path=/trunk/; revision=3661
  • Loading branch information...
commit 1bc8d853ebc56a7f6058ad655f0a5fdf190476f2 1 parent a76a81f
Daniel Veillard authored
Showing with 24 additions and 0 deletions.
  1. +5 −0 ChangeLog
  2. +19 −0 testURI.c
View
5 ChangeLog
@@ -1,3 +1,8 @@
+Tue Oct 16 13:58:41 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * testURI.c: add a debug option printing all the fields within
+ the parsed URI structure
+
Wed Oct 10 10:25:52 CEST 2007 Daniel Veillard <daniel@veillard.com>
* xmlsave.c: fix to avoid a crash when dumping an attribute from
View
19 testURI.c
@@ -18,6 +18,7 @@
static const char *base = NULL;
static int escape = 0;
+static int debug = 0;
static void handleURI(const char *str) {
int ret;
@@ -31,6 +32,19 @@ static void handleURI(const char *str) {
if (ret != 0)
printf("%s : error %d\n", str, ret);
else {
+ if (debug) {
+ if (uri->scheme) printf("scheme: %s\n", uri->scheme);
+ if (uri->opaque) printf("opaque: %s\n", uri->opaque);
+ if (uri->authority) printf("authority: %s\n", uri->authority);
+ if (uri->server) printf("server: %s\n", uri->server);
+ if (uri->user) printf("user: %s\n", uri->user);
+ if (uri->port != 0) printf("port: %d\n", uri->port);
+ if (uri->path) printf("path: %s\n", uri->path);
+ if (uri->query) printf("query: %s\n", uri->query);
+ if (uri->fragment) printf("fragment: %s\n", uri->fragment);
+ if (uri->query_raw) printf("query_raw: %s\n", uri->query_raw);
+ if (uri->cleanup != 0) printf("cleanup\n");
+ }
xmlNormalizeURIPath(uri->path);
if (escape != 0) {
parsed = xmlSaveUri(uri);
@@ -72,6 +86,11 @@ int main(int argc, char **argv) {
arg++;
escape++;
}
+ if ((argc > arg) && (argv[arg] != NULL) &&
+ ((!strcmp(argv[arg], "-debug")) || (!strcmp(argv[arg], "--debug")))) {
+ arg++;
+ debug++;
+ }
if (argv[arg] == NULL) {
char str[1024];
Please sign in to comment.
Something went wrong with that request. Please try again.