beosmain.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // -*- C++ -*-
  2. /*
  3. Copyright (c) 1990-2000 Info-ZIP. All rights reserved.
  4. See the accompanying file LICENSE, version 2000-Apr-09 or later
  5. (the contents of which are also included in unzip.h) for terms of use.
  6. If, for some reason, all these files are missing, the Info-ZIP license
  7. also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
  8. */
  9. //
  10. // WARNING: This is C++, not C! GNU C is not supported here!
  11. //
  12. // beos_init.cpp
  13. //
  14. // BeOS-specific C++ routines for use with Info-ZIP's UnZip 5.30 or later.
  15. //
  16. // This is necessary because we need to have an app_server connection to be
  17. // able to ask the system to assign a MIME type to an un-typed file. Strange
  18. // but true (the update_mime_info() call needs to send/receive messages).
  19. //
  20. // If you're writing your own Zip application, you probably DO NOT want to
  21. // include this file!
  22. #include <app/Application.h>
  23. #ifdef SFX
  24. const static char *unzip_signature = "application/x-vnd.Info-ZIP.UnZipSFX";
  25. #else
  26. const static char *unzip_signature = "application/x-vnd.Info-ZIP.UnZip";
  27. #endif
  28. extern "C" int main_stub( int argc, char *argv[] );
  29. int main( int argc, char **argv )
  30. {
  31. BApplication app( unzip_signature );
  32. int retval = main_stub( argc, argv );
  33. app.PostMessage( B_QUIT_REQUESTED );
  34. app.Run();
  35. return retval;
  36. }