Permalink
Browse files

Create makefile to build samples

  • Loading branch information...
1 parent 4e5add1 commit e2fcf4b4f858c79968227e21c0d40d684bf560a1 @terrymah committed Dec 30, 2011
Showing with 214 additions and 113 deletions.
  1. +5 −0 .gitignore
  2. +43 −0 samples/makefile
  3. +2 −2 samples/nameprop/main.cpp
  4. +33 −0 samples/out.txt
  5. +2 −2 samples/pstdir/main.cpp
  6. +79 −69 samples/pstvalues/values.pl
  7. +5 −2 samples/storeinfo/main.cpp
  8. +3 −38 test/makefile
  9. +42 −0 test/makefile.inc
View
@@ -21,3 +21,8 @@ Testing
CTestTestfile.cmake
/doc/html
/samples/pstvalues/values.h
+/samples/nprop
+/samples/pstattach
+/samples/pst_dir
+/samples/pstinfo
+/samples/pstval
View
@@ -0,0 +1,43 @@
+include ../test/makefile.inc
+
+#
+# Fairport sample apps
+#
+
+ifeq ($(OS), windows)
+NAMEPROP=nprop.exe
+PSTATTACHMENT=pstattach.exe
+PSTDIR=pst_dir.exe
+STOREINFO=pstinfo.exe
+PSTVALUES=pstval.exe
+else
+NAMEPROP=nprop
+PSTATTACHMENT=pstattach
+PSTDIR=pst_dir
+STOREINFO=pstinfo
+PSTVALUES=pstval
+endif
+
+#all: $(NAMEPROP) $(PSTATTACHMENT) $(PSTDIR) $(STOREINFO) $(PSTVALUES)
+all: $(NAMEPROP) $(PSTATTACHMENT) $(PSTDIR) $(STOREINFO)
+
+$(NAMEPROP): nameprop/main.cpp
+ $(CC) nameprop/main.cpp $(OPTIONS) $(OUTPUT)$(NAMEPROP)
+
+$(PSTATTACHMENT): pstattachment/main.cpp
+ $(CC) pstattachment/main.cpp $(OPTIONS) $(OUTPUT)$(PSTATTACHMENT)
+
+$(PSTDIR): pstdir/main.cpp
+ $(CC) pstdir/main.cpp $(OPTIONS) $(OUTPUT)$(PSTDIR)
+
+$(STOREINFO): storeinfo/main.cpp
+ $(CC) storeinfo/main.cpp $(OPTIONS) $(OUTPUT)$(STOREINFO)
+
+$(PSTVALUES): pstvalues/main.cpp pstvalues/values.h
+ $(CC) pstvalues/main.cpp $(OPTIONS) $(OUTPUT)$(PSTVALUES)
+
+pstvalues/values.h: pstvalues/values.pl
+ cd pstvalues; perl values.pl ../../fairport/disk/disk.h ../../fairport/util/primitives.h > values.h
+
+clean:
+ $(DELCMD) $(NAMEPROP) $(PSTATTACHMENT) $(PSTDIR) $(STOREINFO) $(PSTVALUES)
@@ -105,7 +105,7 @@ int main()
// When structures address into the string stream, they are giving the
// offset of the long value for the length of the string they want to access.
prop_stream sstream(names.open_prop_stream(0x4));
- ulong size;
+ fairport::ulong size;
std::vector<char> buffer;
cout << endl << "String Stream (offset, size: string) : " << endl;
@@ -120,7 +120,7 @@ int main()
wcout << setw(6) << ((size_t)sstream.tellg() - size - 4) << ", " << setw(4) << size << ": " << val << endl;
size_t pos = (size_t)sstream.tellg();
- pos = (pos + 3L & ~3L);
+ pos = ((pos + 3L) & ~3L);
sstream.seekg(pos);
}
View
@@ -0,0 +1,33 @@
+In file included from ../fairport/util/btree.h:23:0,
+ from ../fairport/ndb/database.h:14,
+ from ../fairport/pst/pst.h:20,
+ from ../fairport/pst.h:88,
+ from pstdir/main.cpp:5:
+../fairport/util/primitives.h:21:89: note: #pragma message: C++0x rvalue references not supported; consider updating your compiler
+In file included from /usr/include/c++/4.6/algorithm:63:0,
+ from pstdir/main.cpp:2:
+/usr/include/c++/4.6/bits/stl_algo.h: In function ‘_Funct std::for_each(_IIter, _IIter, _Funct) [with _IIter = boost::transform_iterator<fairport::message_transform_row, fairport::const_table_row_iter>, _Funct = std::tr1::_Bind<void (*(int, std::tr1::_Placeholder<1>))(int, const fairport::message&)>]’:
+pstdir/main.cpp:30:88: instantiated from here
+/usr/include/c++/4.6/bits/stl_algo.h:4302:2: error: no match for call to ‘(std::tr1::_Bind<void (*(int, std::tr1::_Placeholder<1>))(int, const fairport::message&)>) (boost::iterator_facade<boost::transform_iterator<fairport::message_transform_row, fairport::const_table_row_iter>, fairport::message, boost::detail::iterator_category_with_traversal<std::input_iterator_tag, boost::random_access_traversal_tag>, fairport::message, int>::reference)’
+/usr/include/c++/4.6/tr1/functional:1134:11: note: candidates are:
+/usr/include/c++/4.6/tr1/functional:1205:9: note: typename std::tr1::result_of<_Functor(typename std::tr1::result_of<std::tr1::_Mu<_Bound_args>(_Bound_args, std::tr1::tuple<_UElements ...>)>::type ...)>::type std::tr1::_Bind<_Functor(_Bound_args ...)>::operator()(_Args& ...) [with _Args = {fairport::message}, _Functor = void (*)(int, const fairport::message&), _Bound_args = {int, std::tr1::_Placeholder<1>}, typename std::tr1::result_of<_Functor(typename std::tr1::result_of<std::tr1::_Mu<_Bound_args>(_Bound_args, std::tr1::tuple<_UElements ...>)>::type ...)>::type = void]
+/usr/include/c++/4.6/tr1/functional:1205:9: note: no known conversion for argument 1 from ‘boost::iterator_facade<boost::transform_iterator<fairport::message_transform_row, fairport::const_table_row_iter>, fairport::message, boost::detail::iterator_category_with_traversal<std::input_iterator_tag, boost::random_access_traversal_tag>, fairport::message, int>::reference {aka fairport::message}’ to ‘fairport::message&’
+/usr/include/c++/4.6/tr1/functional:1216:9: note: typename std::tr1::result_of<const _Functor(typename std::tr1::result_of<std::tr1::_Mu<_Bound_args>(_Bound_args, std::tr1::tuple<_UElements ...>)>::type ...)>::type std::tr1::_Bind<_Functor(_Bound_args ...)>::operator()(_Args& ...) const [with _Args = {fairport::message}, _Functor = void (*)(int, const fairport::message&), _Bound_args = {int, std::tr1::_Placeholder<1>}, typename std::tr1::result_of<const _Functor(typename std::tr1::result_of<std::tr1::_Mu<_Bound_args>(_Bound_args, std::tr1::tuple<_UElements ...>)>::type ...)>::type = void]
+/usr/include/c++/4.6/tr1/functional:1216:9: note: no known conversion for argument 1 from ‘boost::iterator_facade<boost::transform_iterator<fairport::message_transform_row, fairport::const_table_row_iter>, fairport::message, boost::detail::iterator_category_with_traversal<std::input_iterator_tag, boost::random_access_traversal_tag>, fairport::message, int>::reference {aka fairport::message}’ to ‘fairport::message&’
+/usr/include/c++/4.6/tr1/functional:1228:9: note: typename std::tr1::result_of<volatile _Functor(typename std::tr1::result_of<std::tr1::_Mu<_Bound_args>(_Bound_args, std::tr1::tuple<_UElements ...>)>::type ...)>::type std::tr1::_Bind<_Functor(_Bound_args ...)>::operator()(_Args& ...) volatile [with _Args = {fairport::message}, _Functor = void (*)(int, const fairport::message&), _Bound_args = {int, std::tr1::_Placeholder<1>}, typename std::tr1::result_of<volatile _Functor(typename std::tr1::result_of<std::tr1::_Mu<_Bound_args>(_Bound_args, std::tr1::tuple<_UElements ...>)>::type ...)>::type = void]
+/usr/include/c++/4.6/tr1/functional:1228:9: note: no known conversion for argument 1 from ‘boost::iterator_facade<boost::transform_iterator<fairport::message_transform_row, fairport::const_table_row_iter>, fairport::message, boost::detail::iterator_category_with_traversal<std::input_iterator_tag, boost::random_access_traversal_tag>, fairport::message, int>::reference {aka fairport::message}’ to ‘fairport::message&’
+/usr/include/c++/4.6/tr1/functional:1241:9: note: typename std::tr1::result_of<const volatile _Functor(typename std::tr1::result_of<std::tr1::_Mu<_Bound_args>(_Bound_args, std::tr1::tuple<_UElements ...>)>::type ...)>::type std::tr1::_Bind<_Functor(_Bound_args ...)>::operator()(_Args& ...) const volatile [with _Args = {fairport::message}, _Functor = void (*)(int, const fairport::message&), _Bound_args = {int, std::tr1::_Placeholder<1>}, typename std::tr1::result_of<const volatile _Functor(typename std::tr1::result_of<std::tr1::_Mu<_Bound_args>(_Bound_args, std::tr1::tuple<_UElements ...>)>::type ...)>::type = void]
+/usr/include/c++/4.6/tr1/functional:1241:9: note: no known conversion for argument 1 from ‘boost::iterator_facade<boost::transform_iterator<fairport::message_transform_row, fairport::const_table_row_iter>, fairport::message, boost::detail::iterator_category_with_traversal<std::input_iterator_tag, boost::random_access_traversal_tag>, fairport::message, int>::reference {aka fairport::message}’ to ‘fairport::message&’
+/usr/include/c++/4.6/bits/stl_algo.h: In function ‘_Funct std::for_each(_IIter, _IIter, _Funct) [with _IIter = boost::transform_iterator<fairport::folder_transform_row, boost::filter_iterator<fairport::is_nid_type<2u>, fairport::const_table_row_iter> >, _Funct = std::tr1::_Bind<void (*(int, std::tr1::_Placeholder<1>))(int, const fairport::folder&)>]’:
+pstdir/main.cpp:31:93: instantiated from here
+/usr/include/c++/4.6/bits/stl_algo.h:4302:2: error: no match for call to ‘(std::tr1::_Bind<void (*(int, std::tr1::_Placeholder<1>))(int, const fairport::folder&)>) (boost::iterator_facade<boost::transform_iterator<fairport::folder_transform_row, boost::filter_iterator<fairport::is_nid_type<2u>, fairport::const_table_row_iter> >, fairport::folder, boost::detail::iterator_category_with_traversal<std::input_iterator_tag, boost::bidirectional_traversal_tag>, fairport::folder, int>::reference)’
+/usr/include/c++/4.6/tr1/functional:1134:11: note: candidates are:
+/usr/include/c++/4.6/tr1/functional:1205:9: note: typename std::tr1::result_of<_Functor(typename std::tr1::result_of<std::tr1::_Mu<_Bound_args>(_Bound_args, std::tr1::tuple<_UElements ...>)>::type ...)>::type std::tr1::_Bind<_Functor(_Bound_args ...)>::operator()(_Args& ...) [with _Args = {fairport::folder}, _Functor = void (*)(int, const fairport::folder&), _Bound_args = {int, std::tr1::_Placeholder<1>}, typename std::tr1::result_of<_Functor(typename std::tr1::result_of<std::tr1::_Mu<_Bound_args>(_Bound_args, std::tr1::tuple<_UElements ...>)>::type ...)>::type = void]
+/usr/include/c++/4.6/tr1/functional:1205:9: note: no known conversion for argument 1 from ‘boost::iterator_facade<boost::transform_iterator<fairport::folder_transform_row, boost::filter_iterator<fairport::is_nid_type<2u>, fairport::const_table_row_iter> >, fairport::folder, boost::detail::iterator_category_with_traversal<std::input_iterator_tag, boost::bidirectional_traversal_tag>, fairport::folder, int>::reference {aka fairport::folder}’ to ‘fairport::folder&’
+/usr/include/c++/4.6/tr1/functional:1216:9: note: typename std::tr1::result_of<const _Functor(typename std::tr1::result_of<std::tr1::_Mu<_Bound_args>(_Bound_args, std::tr1::tuple<_UElements ...>)>::type ...)>::type std::tr1::_Bind<_Functor(_Bound_args ...)>::operator()(_Args& ...) const [with _Args = {fairport::folder}, _Functor = void (*)(int, const fairport::folder&), _Bound_args = {int, std::tr1::_Placeholder<1>}, typename std::tr1::result_of<const _Functor(typename std::tr1::result_of<std::tr1::_Mu<_Bound_args>(_Bound_args, std::tr1::tuple<_UElements ...>)>::type ...)>::type = void]
+/usr/include/c++/4.6/tr1/functional:1216:9: note: no known conversion for argument 1 from ‘boost::iterator_facade<boost::transform_iterator<fairport::folder_transform_row, boost::filter_iterator<fairport::is_nid_type<2u>, fairport::const_table_row_iter> >, fairport::folder, boost::detail::iterator_category_with_traversal<std::input_iterator_tag, boost::bidirectional_traversal_tag>, fairport::folder, int>::reference {aka fairport::folder}’ to ‘fairport::folder&’
+/usr/include/c++/4.6/tr1/functional:1228:9: note: typename std::tr1::result_of<volatile _Functor(typename std::tr1::result_of<std::tr1::_Mu<_Bound_args>(_Bound_args, std::tr1::tuple<_UElements ...>)>::type ...)>::type std::tr1::_Bind<_Functor(_Bound_args ...)>::operator()(_Args& ...) volatile [with _Args = {fairport::folder}, _Functor = void (*)(int, const fairport::folder&), _Bound_args = {int, std::tr1::_Placeholder<1>}, typename std::tr1::result_of<volatile _Functor(typename std::tr1::result_of<std::tr1::_Mu<_Bound_args>(_Bound_args, std::tr1::tuple<_UElements ...>)>::type ...)>::type = void]
+/usr/include/c++/4.6/tr1/functional:1228:9: note: no known conversion for argument 1 from ‘boost::iterator_facade<boost::transform_iterator<fairport::folder_transform_row, boost::filter_iterator<fairport::is_nid_type<2u>, fairport::const_table_row_iter> >, fairport::folder, boost::detail::iterator_category_with_traversal<std::input_iterator_tag, boost::bidirectional_traversal_tag>, fairport::folder, int>::reference {aka fairport::folder}’ to ‘fairport::folder&’
+/usr/include/c++/4.6/tr1/functional:1241:9: note: typename std::tr1::result_of<const volatile _Functor(typename std::tr1::result_of<std::tr1::_Mu<_Bound_args>(_Bound_args, std::tr1::tuple<_UElements ...>)>::type ...)>::type std::tr1::_Bind<_Functor(_Bound_args ...)>::operator()(_Args& ...) const volatile [with _Args = {fairport::folder}, _Functor = void (*)(int, const fairport::folder&), _Bound_args = {int, std::tr1::_Placeholder<1>}, typename std::tr1::result_of<const volatile _Functor(typename std::tr1::result_of<std::tr1::_Mu<_Bound_args>(_Bound_args, std::tr1::tuple<_UElements ...>)>::type ...)>::type = void]
+/usr/include/c++/4.6/tr1/functional:1241:9: note: no known conversion for argument 1 from ‘boost::iterator_facade<boost::transform_iterator<fairport::folder_transform_row, boost::filter_iterator<fairport::is_nid_type<2u>, fairport::const_table_row_iter> >, fairport::folder, boost::detail::iterator_category_with_traversal<std::input_iterator_tag, boost::bidirectional_traversal_tag>, fairport::folder, int>::reference {aka fairport::folder}’ to ‘fairport::folder&’
+make: *** [pst_dir] Error 1
View
@@ -8,7 +8,7 @@ using namespace std::tr1::placeholders;
void process_message(int tab_depth, const message& m)
{
- for(int i = 0; i < tab_depth; ++i) cout << '\t';
+ for(int i = 0; i < tab_depth; ++i) wcout << '\t';
try {
wcout << m.get_subject() << endl;
@@ -22,7 +22,7 @@ void process_message(int tab_depth, const message& m)
void process_folder(int tab_depth, const folder& f)
{
- for(int i = 0; i < tab_depth; ++i) cout << '\t';
+ for(int i = 0; i < tab_depth; ++i) wcout << '\t';
wcout << f.get_name() << L" (" << f.get_message_count() << L")\n";
for(folder::message_iterator m = f.message_begin(); m != f.message_end(); ++m)
Oops, something went wrong.

0 comments on commit e2fcf4b

Please sign in to comment.