FireBirdLib - Topfield TMS PVR TAP Programming Library
PSBuffer_Init.c
Go to the documentation of this file.
1
#include <stdlib.h>
2
#include <string.h>
3
#include "
libFireBird.h
"
4
5
#undef malloc
6
7
bool
PSBuffer_Init
(
tPSBuffer
*PSBuffer, word PID,
int
BufferSize
)
8
{
9
TRACEENTER
();
10
11
if
(!PSBuffer)
12
{
13
TRACEEXIT
();
14
return
FALSE;
15
}
16
17
memset(PSBuffer, 0,
sizeof
(
tPSBuffer
));
18
19
PSBuffer->
PID
= PID;
20
PSBuffer->
BufferSize
=
BufferSize
;
21
22
PSBuffer->
Buffer
[0].
PSData
= malloc(
BufferSize
*
sizeof
(
byte
));
23
PSBuffer->
Buffer
[0].
FileOffset
= malloc(
BufferSize
*
sizeof
(ulong64));
24
25
PSBuffer->
Buffer
[1].
PSData
= malloc(
BufferSize
*
sizeof
(
byte
));
26
PSBuffer->
Buffer
[1].
FileOffset
= malloc(
BufferSize
*
sizeof
(ulong64));
27
28
PSBuffer->
LastContCounter
= 255;
29
30
PSBuffer->
pInBuffer
= &PSBuffer->
Buffer
[0];
31
PSBuffer->
pInBufferData
= &PSBuffer->
pInBuffer
->
PSData
[0];
32
33
TRACEEXIT
();
34
35
//Make sure all buffers have an valid pointer
36
return
(PSBuffer->
Buffer
[0].
PSData
&& PSBuffer->
Buffer
[0].
FileOffset
&& PSBuffer->
Buffer
[1].
PSData
&& PSBuffer->
Buffer
[1].
FileOffset
);
37
}
BufferSize
dword BufferSize
Definition:
INIOpenFile.c:7
PSBuffer_Init
bool PSBuffer_Init(tPSBuffer *PSBuffer, word PID, int BufferSize)
Definition:
PSBuffer_Init.c:7
libFireBird.h
TRACEEXIT
#define TRACEEXIT()
Definition:
libFireBird.h:1244
TRACEENTER
#define TRACEENTER()
Definition:
libFireBird.h:1243
tBuffer::PSData
byte * PSData
Definition:
libFireBird.h:2454
tBuffer::FileOffset
ulong64 * FileOffset
Definition:
libFireBird.h:2456
tPSBuffer
Definition:
libFireBird.h:2460
tPSBuffer::PID
word PID
Definition:
libFireBird.h:2461
tPSBuffer::BufferSize
int BufferSize
Definition:
libFireBird.h:2467
tPSBuffer::pInBuffer
tBuffer * pInBuffer
Definition:
libFireBird.h:2465
tPSBuffer::LastContCounter
byte LastContCounter
Definition:
libFireBird.h:2469
tPSBuffer::pInBufferData
byte * pInBufferData
Definition:
libFireBird.h:2466
tPSBuffer::Buffer
tBuffer Buffer[2]
Definition:
libFireBird.h:2462
rec
PSBuffer_Init.c
Generated on Fri Apr 29 2022 13:34:01 for FireBirdLib - Topfield TMS PVR TAP Programming Library by
1.9.3