diff --git a/src/tools/Jamfile b/src/tools/Jamfile index 602383e43c..f8b6623f2b 100644 --- a/src/tools/Jamfile +++ b/src/tools/Jamfile @@ -2,4 +2,5 @@ SubDir OBOS_TOP src tools ; SubInclude OBOS_TOP src tools cppunit ; SubInclude OBOS_TOP src tools hey ; +SubInclude OBOS_TOP src tools unflatten ; diff --git a/src/tools/unflatten/Jamfile b/src/tools/unflatten/Jamfile new file mode 100644 index 0000000000..7fe0b78a9b --- /dev/null +++ b/src/tools/unflatten/Jamfile @@ -0,0 +1,4 @@ +SubDir OBOS_TOP src tools unflatten ; + +BinCommand unflatten : unflatten.cpp : be ; + diff --git a/src/tools/unflatten/unflatten.cpp b/src/tools/unflatten/unflatten.cpp new file mode 100644 index 0000000000..f1e8d248d6 --- /dev/null +++ b/src/tools/unflatten/unflatten.cpp @@ -0,0 +1,28 @@ +/* + * Copyright 2002, Marcus Overhagen. All rights reserved. + * Distributed under the terms of the MIT License. + */ + +#include +#include +#include + +int main(int argc, char *argv[]) +{ + BFile file; + BMessage msg; + if (argc != 2) { + fprintf(stderr, "You need to specify a filename on the command line.\n"); + return 1; + } + if (B_OK != file.SetTo(argv[1], O_RDONLY)) { + fprintf(stderr, "File \"%s\" not found.\n", argv[1]); + return 1; + } + if (B_OK != msg.Unflatten(&file)) { + fprintf(stderr, "Unflatten failed.\n"); + return 1; + } + msg.PrintToStream(); + return 0; +}