2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
11 * INCLUDES ___________________________________________________________________
18 #include <afs/param.h>
23 #include "partition_utils.h"
24 #include <afs\afs_cfgAdmin.h>
28 * DEFINITIONS _________________________________________________________________
31 static cfg_partitionEntry_t
*pTable
= 0; // Partition table
32 static int cPartitions
= 0; // Count of partitions
36 * EXPORTED FUNCTIONS _________________________________________________________
39 cfg_partitionEntry_t
*GetPartitionTable(int &nNumPartitions
)
41 nNumPartitions
= cPartitions
;
46 int GetNumPartitions()
51 int ReadPartitionTable(afs_status_t
*pStatus
)
60 int nResult
= cfg_HostPartitionTableEnumerate(g_hServer
, &pTable
, &cPartitions
, pStatus
);
65 BOOL
IsAnAfsPartition(LPCTSTR pszRootDir
)
67 for (int ii
= 0; ii
< cPartitions
; ii
++) {
69 TCHAR ch1
= pTable
[ii
].deviceName
[0];
73 TCHAR ch2
= pszRootDir
[0];
84 BOOL
DoesPartitionExist(LPCTSTR pszName
)
86 for (int ii
= 0; ii
< cPartitions
; ii
++) {
87 if (lstrcmp(A2S(pTable
[ii
].partitionName
), pszName
) == 0)
94 void FreePartitionTable()
98 cfg_PartitionListDeallocate(pTable
, &nStatus
);