DVBCore  20.3.0
DVBCore Documentation
dvbver.c
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2004 Ocean Blue Software Ltd
4  *
5  * This file is part of a DTVKit Software Component
6  * You are permitted to copy, modify or distribute this file subject to the terms
7  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
8  *
9  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
10  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
11  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
12  *
13  * If you or your organisation is not a member of DTVKit then you have access
14  * to this source code outside of the terms of the licence agreement
15  * and you are expected to delete this and any associated files immediately.
16  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
17  *******************************************************************************/
24 #include <string.h>
25 #include <dvbver.h>
26 
27 /* The DVB_VER_* must be defined (via compiler -D flag) */
28 #ifndef DVB_VER_MAJOR
29 #error DVB_VER_MAJOR is undefined!
30 #endif
31 #ifndef DVB_VER_MINOR
32 #error DVB_VER_MINOR is undefined!
33 #endif
34 #ifndef DVB_VER_PATCH
35 #error DVB_VER_PATCH is undefined!
36 #endif
37 
38 #define xstr(s) str(s)
39 #define str(s) # s
40 #define DVB_VER_STRING (xstr(DVB_VER_MAJOR) "." xstr(DVB_VER_MINOR) "." xstr(DVB_VER_PATCH))
41 
42 static const char *dvb_version_string = DVB_VER_STRING;
43 
44 static const DVB_VER_STRUCT dvb_ver_number = {
45  DVB_VER_MAJOR, DVB_VER_MINOR, DVB_VER_PATCH
46 };
47 
48 
49 U8BIT* App_DvbVersionString(void)
50 {
51  return (U8BIT *)(dvb_version_string);
52 }
53 
54 U32BIT App_DvbVersionNumber(void)
55 {
56  return((dvb_ver_number.major << 16) | (dvb_ver_number.minor << 8) | (dvb_ver_number.revision));
57 }
58 
59 void App_DvbVersionData(DVB_VER_STRUCT *vptr)
60 {
61  if (vptr != NULL)
62  {
63  memcpy(vptr, &dvb_ver_number, sizeof(DVB_VER_STRUCT));
64  }
65 }
66 
Application Version support functions.