Change the callback function to use void**.
[apps/agl-service-can-low-level.git] / example / client.c
index 95112e4..e6e9a2e 100644 (file)
 #include "fileproto.pb.h"
 #include "common.h"
 
-bool printfile_callback(pb_istream_t *stream, const pb_field_t *field, void *arg)
+bool printfile_callback(pb_istream_t *stream, const pb_field_t *field, void **arg)
 {
     FileInfo fileinfo;
     
     if (!pb_decode(stream, FileInfo_fields, &fileinfo))
         return false;
     
-    printf("%-10lld %s\n", fileinfo.inode, fileinfo.name);
+    printf("%-10lld %s\n", (long long)fileinfo.inode, fileinfo.name);
     
     return true;
 }
@@ -72,7 +72,7 @@ bool listdir(int fd, char *path)
     
     if (!pb_decode(&input, ListFilesResponse_fields, &response))
     {
-        fprintf(stderr, "Decoding failed.\n");
+        fprintf(stderr, "Decode failed: %s\n", PB_GET_ERROR(&input));
         return false;
     }