consio.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef _RAR_CONSIO_
  2. #define _RAR_CONSIO_
  3. #if !defined(SILENT) && !defined(SFX_MODULE)
  4. enum {SOUND_OK,SOUND_ALARM,SOUND_ERROR,SOUND_QUESTION};
  5. #endif
  6. enum PASSWORD_TYPE {PASSWORD_GLOBAL,PASSWORD_FILE,PASSWORD_ARCHIVE};
  7. void InitConsoleOptions(MESSAGE_TYPE MsgStream,bool Sound);
  8. #ifndef SILENT
  9. void mprintf(const char *fmt,...);
  10. void eprintf(const char *fmt,...);
  11. void Alarm();
  12. void GetPasswordText(wchar *Str,uint MaxLength);
  13. bool GetPassword(PASSWORD_TYPE Type,const char *FileName,const wchar *FileNameW,wchar *Password,uint MaxLength);
  14. int Ask(const char *AskStr);
  15. #endif
  16. void OutComment(char *Comment,size_t Size);
  17. #ifdef SILENT
  18. #ifdef __GNUC__
  19. #define mprintf(args...)
  20. #define eprintf(args...)
  21. #else
  22. inline void mprintf(const char *fmt,...) {}
  23. inline void eprintf(const char *fmt,...) {}
  24. #endif
  25. inline void Alarm() {}
  26. inline void GetPasswordText(wchar *Str,uint MaxLength) {}
  27. inline bool GetPassword(PASSWORD_TYPE Type,const char *FileName,const wchar *FileNameW,wchar *Password,uint MaxLength) {return(false);}
  28. inline int Ask(const char *AskStr) {return(0);}
  29. #endif
  30. #endif