FireBirdLib - Topfield TMS PVR TAP Programming Library
HDD_BuildExtDriveList.c
Go to the documentation of this file.
1#include <sys/statvfs.h>
2#include "libFireBird.h"
3
4bool HDD_BuildExtDriveList(textPartitionInfo *ExtPartitionList, dword *NrListItems)
5{
6 static dword *__nExtPartition = NULL;
7 static textPartitionInfo *__extPartitionInfo = NULL;
8 dword i;
9
10 if(NrListItems) *NrListItems = 0;
11
12 //Resolve all firmware functions and variables
13 if(!__nExtPartition)
14 {
15 __nExtPartition = (dword*)FIS_vnExtPartition();
16 if(!__nExtPartition) return FALSE;
17 }
18
19 if(!__extPartitionInfo)
20 {
21 __extPartitionInfo = (textPartitionInfo*)FIS_vExtPartitionInfo();
22 if(!__extPartitionInfo) return FALSE;
23 }
24
25 //Check if an external disk has been mounted
26 if(*__nExtPartition == 0) return FALSE;
27
28 i = *__nExtPartition;
29 if(i > 10) i = 10;
30
31 if(ExtPartitionList) memcpy(ExtPartitionList, __extPartitionInfo, i * sizeof(textPartitionInfo));
32
33 if(NrListItems) *NrListItems = i;
34
35 return TRUE;
36}
dword FIS_vExtPartitionInfo(void)
dword FIS_vnExtPartition(void)
bool HDD_BuildExtDriveList(textPartitionInfo *ExtPartitionList, dword *NrListItems)