home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2008 February / PCWFEB08.iso / Software / Resources / Utilities / Partition Logic 0.68 / partlogic-0.68.iso / system / headers / sys / progress.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-10  |  1.8 KB  |  58 lines

  1. // 
  2. //  Visopsys
  3. //  Copyright (C) 1998-2007 J. Andrew McLaughlin
  4. //  
  5. //  This library is free software; you can redistribute it and/or modify it
  6. //  under the terms of the GNU Lesser General Public License as published by
  7. //  the Free Software Foundation; either version 2.1 of the License, or (at
  8. //  your option) any later version.
  9. //
  10. //  This library is distributed in the hope that it will be useful, but
  11. //  WITHOUT ANY WARRANTY; without even the implied warranty of
  12. //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
  13. //  General Public License for more details.
  14. //
  15. //  You should have received a copy of the GNU Lesser General Public License
  16. //  along with this library; if not, write to the Free Software Foundation,
  17. //  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18. //
  19. //  progress.h
  20. //
  21.  
  22. // This file contains definitions and structures for using and manipulating
  23. // progress structures in Visopsys.  Progress structures can be used in some
  24. // places to communicate the status of longer operations, for example long
  25. // filesystem operations, between user programs and the kernel.
  26.  
  27. #if !defined(_PROGRESS_H)
  28.  
  29. #include <sys/lock.h>
  30.  
  31. // The maximum length of status messages
  32. #define PROGRESS_MAX_MESSAGELEN   240
  33.  
  34. // These are different kinds of possible responses when the operation
  35. // needs user feedback
  36. #define PROGRESS_RESPONSE_OK      0x0001
  37. #define PROGRESS_RESPONSE_CANCEL  0x0002
  38. #define PROGRESS_RESPONSE_YES     0x0004
  39. #define PROGRESS_RESPONSE_NO      0x0008
  40.  
  41. typedef volatile struct {
  42.   unsigned total;
  43.   unsigned finished;
  44.   int percentFinished;
  45.   char statusMessage[PROGRESS_MAX_MESSAGELEN];
  46.   char confirmMessage[PROGRESS_MAX_MESSAGELEN];
  47.   int needConfirm;
  48.   int confirm;
  49.   int error;
  50.   int canCancel;
  51.   int cancel;
  52.   lock lock;
  53.  
  54. } progress;
  55.  
  56. #define _PROGRESS_H
  57. #endif
  58.