FireBirdLib - Topfield TMS PVR TAP Programming Library
StringDBLoadFromFile.c
Go to the documentation of this file.
1
#include <stdlib.h>
2
#include <string.h>
3
#include "
libFireBird.h
"
4
5
bool
StringDBLoadFromFile
(
tStringDB
*StringDB, TYPE_File *f)
6
{
7
TRACEENTER
();
8
9
dword l, p;
10
11
if
(!StringDB || !f)
12
{
13
TRACEEXIT
();
14
return
FALSE;
15
}
16
17
TAP_MemFree(StringDB->
DB
);
18
19
//DB Size
20
TAP_Hdd_Fread(&l,
sizeof
(dword), 1, f);
21
StringDB->
DB
= TAP_MemAlloc(l);
22
23
if
(!StringDB->
DB
)
24
{
25
StringDB->
DBSize
= 0;
26
TAP_Hdd_Fclose(f);
27
28
TRACEEXIT
();
29
return
FALSE;
30
}
31
StringDB->
DBSize
= l;
32
StringDB->
DBEnd
= l + StringDB->
DB
- 1;
33
34
//Current pointer
35
TAP_Hdd_Fread(&p,
sizeof
(dword), 1, f);
36
StringDB->
DBPtr
= p + StringDB->
DB
;
37
38
TAP_Hdd_Fread(StringDB->
DB
, 1, l, f);
39
40
TRACEEXIT
();
41
return
TRUE;
42
}
StringDBLoadFromFile
bool StringDBLoadFromFile(tStringDB *StringDB, TYPE_File *f)
Definition:
StringDBLoadFromFile.c:5
libFireBird.h
TRACEEXIT
#define TRACEEXIT()
Definition:
libFireBird.h:1244
TRACEENTER
#define TRACEENTER()
Definition:
libFireBird.h:1243
tStringDB
Definition:
libFireBird.h:2547
tStringDB::DBSize
dword DBSize
Definition:
libFireBird.h:2548
tStringDB::DB
char * DB
Definition:
libFireBird.h:2549
tStringDB::DBEnd
char * DBEnd
Definition:
libFireBird.h:2551
tStringDB::DBPtr
char * DBPtr
Definition:
libFireBird.h:2550
StringDB
StringDBLoadFromFile.c
Generated on Fri Apr 29 2022 13:34:01 for FireBirdLib - Topfield TMS PVR TAP Programming Library by
1.9.3