Add a simple utility to dump flattened BMessages. Added it to the image as well.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31897 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -44,7 +44,7 @@ SYSTEM_BIN = "[" addattr alert arp base64 basename bash bc beep bootman bzip2
|
|||||||
keymap kill less lessecho lesskey link linkcatkeys listarea listattr
|
keymap kill less lessecho lesskey link linkcatkeys listarea listattr
|
||||||
listimage listdev
|
listimage listdev
|
||||||
listport listres listsem listusb ln locate logger login logname ls lsindex
|
listport listres listsem listusb ln locate logger login logname ls lsindex
|
||||||
makebootable md5sum merge mimeset mkdos mkdir mkfifo mkfs mkindex
|
makebootable md5sum merge message mimeset mkdos mkdir mkfifo mkfs mkindex
|
||||||
modifiers mount mount_nfs mountvolume mv
|
modifiers mount mount_nfs mountvolume mv
|
||||||
nc netstat nl nohup
|
nc netstat nl nohup
|
||||||
od open
|
od open
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ StdBinCommands
|
|||||||
listres.cpp
|
listres.cpp
|
||||||
mimeset.cpp
|
mimeset.cpp
|
||||||
mkindex.cpp
|
mkindex.cpp
|
||||||
|
message.cpp
|
||||||
modifiers.cpp
|
modifiers.cpp
|
||||||
open.cpp
|
open.cpp
|
||||||
play.cpp
|
play.cpp
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2009, Michael Lotz, [email protected].
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <File.h>
|
||||||
|
#include <Message.h>
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
if (argc != 2) {
|
||||||
|
printf("usage: %s <flattened message file>\n", argv[0]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
BFile input(argv[1], B_READ_ONLY);
|
||||||
|
if (!input.IsReadable()) {
|
||||||
|
printf("cannot open \"%s\" for reading\n", argv[1]);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
BMessage message;
|
||||||
|
status_t result = message.Unflatten(&input);
|
||||||
|
if (result != B_OK) {
|
||||||
|
printf("failed to unflatten message: %s\n", strerror(result));
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message.PrintToStream();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user