summaryrefslogtreecommitdiff
path: root/libdtv/libvdr/libvdr.h
blob: 421b2e7190894ba5af3011dae93fd32a3753854f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
//////////////////////////////////////////////////////////////
///                                                        ///
/// libvdr.h: definitions necessary for the libvdr package ///
///                                                        ///
//////////////////////////////////////////////////////////////

// $Revision: 1.4 $
// $Date: 2001/10/06 15:33:46 $
// $Author: hakenes $
//
//   (C) 1992-2001 Rolf Hakenes <hakenes@hippomi.de>, under the GNU GPL.
//
// libvdr is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// libvdr is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You may have received a copy of the GNU General Public License
// along with libvdr; see the file COPYING.  If not, write to the
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.

#ifndef LIBVDR_H
#define LIBVDR_H

#ifdef __cplusplus
extern "C" {
#endif

struct LIST *createVdrProgramInfos (unsigned char *);

#ifdef __cplusplus
}
#endif

struct VdrProgramInfo {
   struct NODE          Node;
   int                  EventID;
   int                  TransportStreamID;
   int                  ServiceID;
   time_t               StartTime;
   time_t               Duration;
   unsigned short       Status;
   char                 LanguageCode[4];
   unsigned short       Rating;
   unsigned short       ContentNibble1;
   unsigned short       ContentNibble2;
   char                *ShortName;
   char                *ShortText;
   char                *ExtendedName;
   char                *ExtendedText;
   int                  ReferenceServiceID;
   int                  ReferenceEventID;
};


#define CreateVdrProgramInfo(cinf, evid, tpid, svid, stst, dura, sta) \
   do \
   { \
      xCreateNode (cinf, NULL); \
      cinf->EventID = evid; \
      cinf->TransportStreamID = tpid; \
      cinf->ServiceID = svid; \
      cinf->StartTime = stst; \
      cinf->Duration = dura; \
      cinf->Status = sta; \
      cinf->LanguageCode[0] = 0; \
      cinf->Rating = 0; \
      cinf->ContentNibble1 = 0; \
      cinf->ContentNibble2 = 0; \
      cinf->ShortName = NULL; \
      cinf->ShortText = NULL; \
      cinf->ExtendedName = NULL; \
      cinf->ExtendedText = NULL; \
      cinf->ReferenceServiceID = 0; \
      cinf->ReferenceEventID = 0; \
   } while (0)

#define AddToText(src, dest) \
   do { \
      if (dest) \
      { \
         char *tmbuf; \
         xMemAlloc (strlen (src) + strlen (dest) + 4, &tmbuf); \
         sprintf (tmbuf, "%s%s", (dest), (src)); \
         xMemFree (dest); (dest) = tmbuf; \
      } else { \
         (dest) = xSetText (src); \
      } \
   } while (0)


#define AddItemToText(src, dest) \
   do { \
      if (dest) \
      { \
         char *tmbuf; \
         xMemAlloc (strlen (src) + strlen (dest) + 4, &tmbuf); \
         sprintf (tmbuf, "%s|%s", (dest), (src)); \
         xMemFree (dest); (dest) = tmbuf; \
      } else { \
         (dest) = xSetText (src); \
      } \
   } while (0)

#endif