I have build successful libtidy on qt4

Now how i cann translate this C++ sample to make

bool Clean_Code_utf8(QString incomming_file, QString output_file, QString config_file)

Have anibody experience on tidy? I understand tidy only from php....

Qt Code:
  1. #include <tidy.h>
  2. #include <buffio.h>
  3. #include <stdio.h>
  4. #include <errno.h>
  5.  
  6.  
  7. int main(int argc, char **argv )
  8. {
  9. const char* input = "<title>Foo</title><p>Foo!";
  10. TidyBuffer output = {0};
  11. TidyBuffer errbuf = {0};
  12. int rc = -1;
  13. Bool ok;
  14.  
  15. TidyDoc tdoc = tidyCreate(); // Initialize "document"
  16. printf( "Tidying:\t%s\n", input );
  17.  
  18. ok = tidyOptSetBool( tdoc, TidyXhtmlOut, yes ); // Convert to XHTML
  19. if ( ok )
  20. rc = tidySetErrorBuffer( tdoc, &errbuf ); // Capture diagnostics
  21. if ( rc >= 0 )
  22. rc = tidyParseString( tdoc, input ); // Parse the input
  23. if ( rc >= 0 )
  24. rc = tidyCleanAndRepair( tdoc ); // Tidy it up!
  25. if ( rc >= 0 )
  26. rc = tidyRunDiagnostics( tdoc ); // Kvetch
  27. if ( rc > 1 ) // If error, force output.
  28. rc = ( tidyOptSetBool(tdoc, TidyForceOutput, yes) ? rc : -1 );
  29. if ( rc >= 0 )
  30. rc = tidySaveBuffer( tdoc, &output ); // Pretty Print
  31.  
  32. if ( rc >= 0 )
  33. {
  34. if ( rc > 0 )
  35. printf( "\nDiagnostics:\n\n%s", errbuf.bp );
  36. printf( "\nAnd here is the result:\n\n%s", output.bp );
  37. }
  38. else
  39. printf( "A severe error (%d) occurred.\n", rc );
  40.  
  41. tidyBufFree( &output );
  42. tidyBufFree( &errbuf );
  43. tidyRelease( tdoc );
  44. return rc;
  45. }
To copy to clipboard, switch view to plain text mode 

Subversion dir...
svn co http://ciz.ch/svnciz/forms_shop/lib_tidy_src/ libtydy
Compile ok on window...


pro file ....
Qt Code:
  1. DEPENDPATH += . include
  2. INCLUDEPATH += . include
  3. TEMPLATE =lib
  4. CONFIG += qt warn_off release staticlib
  5. LANGUAGE = C++
  6. #DEFINES -= UNICODE
  7. DEFINES += NDEBUG THREAD_SAFE=1 TEMP_STORE=2
  8.  
  9. DESTDIR = ../all_os_libs/
  10. win32:TARGET = tidy
  11. unix:TARGET = tidy
  12. mac:TARGET = tidy
To copy to clipboard, switch view to plain text mode