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 ___________________________________________________________________
15 #include <afs/param.h>
20 #include "partition_utils.h"
21 #include <afs\afs_cfgAdmin.h>
25 * DEFINITIONS _________________________________________________________________
28 static cfg_partitionEntry_t *pTable = 0; // Partition table
29 static int cPartitions = 0; // Count of partitions
33 * EXPORTED FUNCTIONS _________________________________________________________
36 cfg_partitionEntry_t *GetPartitionTable(int &nNumPartitions)
38 nNumPartitions = cPartitions;
43 int GetNumPartitions()
48 int ReadPartitionTable(afs_status_t *pStatus)
57 int nResult = cfg_HostPartitionTableEnumerate(g_hServer, &pTable, &cPartitions, pStatus);
62 BOOL IsAnAfsPartition(LPCTSTR pszRootDir)
64 for (int ii = 0; ii < cPartitions; ii++) {
66 TCHAR ch1 = pTable[ii].deviceName[0];
70 TCHAR ch2 = pszRootDir[0];
81 BOOL DoesPartitionExist(LPCTSTR pszName)
83 for (int ii = 0; ii < cPartitions; ii++) {
84 if (lstrcmp(A2S(pTable[ii].partitionName), pszName) == 0)
91 void FreePartitionTable()
95 cfg_PartitionListDeallocate(pTable, &nStatus);