home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lvmtlk12.zip / samples / lvmtest.cpp < prev    next >
C/C++ Source or Header  |  2000-12-10  |  3KB  |  94 lines

  1. /*****************************************************************************
  2. *   This program is free software;  you can redistribute it and/or modify
  3. *   it under the terms of the GNU General Public License as published by
  4. *   the Free Software Foundation; either version 2 of the License, or
  5. *   (at your option) any later version.
  6. *
  7. *   This program is distributed in the hope that it will be useful,
  8. *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
  9. *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
  10. *   the GNU General Public License for more details.
  11. *
  12. *   You should have received a copy of the GNU General Public License
  13. *   along with this program;  if not, write to the Free Software
  14. *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  15. *****************************************************************************/
  16.  
  17. // lvmtest.cpp, program to test the LVM library
  18. //
  19. // By John Martin Alfredsson, jma@jmast.se
  20. //
  21.  
  22. // Includes files for OS/2
  23. //-------------------------
  24. #include <os2.h>
  25.  
  26. // Generic includes
  27. //------------------
  28. #include <stdio.h>
  29. #include <stdlib.h>
  30. #include <string.h>
  31. #include <time.h>
  32. #include <process.h>
  33. #include <conio.h>
  34. #include <io.h>
  35.  
  36. #include "lvm_intr.h"
  37.  
  38.  
  39. int main(int argv, char *argc[])
  40.     {
  41.     CARDINAL32            Error_Code = 99999;
  42.     Volume_Control_Array    vca;
  43.     Volume_Information_Record    vir;
  44.     int                iCounter;
  45.  
  46.  
  47.     Open_LVM_Engine(TRUE, &Error_Code);
  48.     if (Error_Code != 0)
  49.        {
  50.        printf("Open_LVM_Engine Error !!\n");
  51.        return (1);
  52.        }
  53.  
  54.     vca = Get_Volume_Control_Data(&Error_Code);
  55.     if (Error_Code != 0)
  56.        {
  57.        printf("Get_Volume_Control_Data Error !!\n");
  58.        return (1);
  59.        }
  60.  
  61.     for (iCounter = 0; iCounter < vca.Count; iCounter++)
  62.         {
  63.         printf("--------------------------------------\n");
  64.         vir = Get_Volume_Information(vca.Volume_Control_Data[iCounter].Volume_Handle, &Error_Code);
  65.         printf("Volname      : [%c:] %s\n", vir.Current_Drive_Letter, vir.Volume_Name);
  66.         printf("FileSystem   : %s\n", vir.File_System_Name);
  67.  
  68.         if (vir.Status == 0)
  69.            printf("Status       : None\n");
  70.  
  71.         if (vir.Status == 1)
  72.            printf("Status       : Bootable\n");
  73.  
  74.         if (vir.Status == 2)
  75.            printf("Status       : Startable\n");
  76.  
  77.         if (vir.Status == 3)
  78.            printf("Status       : Installable\n");
  79.  
  80.  
  81.         if (vca.Volume_Control_Data[iCounter].Compatibility_Volume == TRUE)
  82.            printf("Volume type  : Compatibility Volume\n");
  83.         else
  84.            printf("Volume type  : LVM Volume\n");
  85.         }
  86.  
  87.     printf("--------------------------------------\n");
  88.  
  89.     Free_Engine_Memory(vca.Volume_Control_Data);
  90.     Close_LVM_Engine();
  91.     }
  92.  
  93.  
  94.