projects
/
project
/
uclient.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
pass the initial / from uclient core to the proto handler
[project/uclient.git]
/
uclient-example.c
diff --git
a/uclient-example.c
b/uclient-example.c
index
b66468a
..
07b330d
100644
(file)
--- a/
uclient-example.c
+++ b/
uclient-example.c
@@
-1,4
+1,6
@@
#include <libubox/blobmsg.h>
#include <libubox/blobmsg.h>
+#include <unistd.h>
+#include <stdio.h>
#include "uclient.h"
#include "uclient.h"
@@
-7,12
+9,12
@@
static void example_header_done(struct uclient *cl)
struct blob_attr *cur;
int rem;
struct blob_attr *cur;
int rem;
-
fprintf(stderr,
"Headers: \n");
+
printf(
"Headers: \n");
blobmsg_for_each_attr(cur, cl->meta, rem) {
blobmsg_for_each_attr(cur, cl->meta, rem) {
-
fprintf(stderr,
"%s=%s\n", blobmsg_name(cur), (char *) blobmsg_data(cur));
+
printf(
"%s=%s\n", blobmsg_name(cur), (char *) blobmsg_data(cur));
}
}
-
fprintf(stderr,
"Contents:\n");
+
printf(
"Contents:\n");
}
static void example_read_data(struct uclient *cl)
}
static void example_read_data(struct uclient *cl)
@@
-25,7
+27,7
@@
static void example_read_data(struct uclient *cl)
if (!len)
return;
if (!len)
return;
-
fwrite(buf, len, 1, stderr
);
+
write(STDOUT_FILENO, buf, len
);
}
}
}
}