FireBirdLib - Topfield TMS PVR TAP Programming Library
HDD_TAP_GetCurrentDir.c
Go to the documentation of this file.
1
#include <string.h>
2
#include "
FBLib_tap.h
"
3
4
//Return codes: 0: OK
5
// -1: not enough memory (from HDD_TAP_GetCurrentDirCluster)
6
// -2: buffer overrun in subdir search (from HDD_TAP_GetCurrentDirCluster)
7
// -3: Lib init failed (from HDD_TranslateDirCluster via HDD_TAP_GetCurrentDirCluster)
8
9
int
HDD_TAP_GetCurrentDir
(
char
*CurrentDir)
10
{
11
TRACEENTER
();
12
13
tTMSTAPTaskTable
*TAPTaskTable;
14
dword *dw;
15
16
//Get all needed variables
17
TAPTaskTable = (
tTMSTAPTaskTable
*)
FIS_vTAPTable
();
18
19
if
(!TAPTaskTable || (!
LibInitialized
&& !
InitTAPex
()))
20
{
21
if
(CurrentDir) CurrentDir[0] =
'\0'
;
22
23
TRACEEXIT
();
24
return
-3;
25
}
26
27
//CurrentDir points to a struct, where the second dword points to NULL terminated string
28
dw = (dword*)TAPTaskTable[
TAP_TableIndex
].CurrentDir;
29
30
//Remove the systems mount point /mnt/hd from the directory
31
if
(CurrentDir && dw && dw[1])
32
strcpy(CurrentDir, (
char
*)(dw[1] + 7));
33
34
TRACEEXIT
();
35
return
0;
36
}
LibInitialized
bool LibInitialized
Definition:
InitTAPex.c:8
FBLib_tap.h
FIS_vTAPTable
dword FIS_vTAPTable(void)
Definition:
FIS_vTAPTable.c:3
HDD_TAP_GetCurrentDir
int HDD_TAP_GetCurrentDir(char *CurrentDir)
Definition:
HDD_TAP_GetCurrentDir.c:9
InitTAPex
bool InitTAPex(void)
Definition:
InitTAPex.c:10
TRACEEXIT
#define TRACEEXIT()
Definition:
libFireBird.h:1244
TRACEENTER
#define TRACEENTER()
Definition:
libFireBird.h:1243
TAP_TableIndex
dword TAP_TableIndex
Definition:
InitTAPex.c:7
tTMSTAPTaskTable
Definition:
libFireBird.h:2576
tap
HDD_TAP_GetCurrentDir.c
Generated on Fri Apr 29 2022 13:34:01 for FireBirdLib - Topfield TMS PVR TAP Programming Library by
1.9.3