Wasabi ExpressPlay SDK for Embedded Systems  1.23.0
WsbLicenseStore.h
Go to the documentation of this file.
1 /*****************************************************************
2 |
3 | Wasabi - License Store API
4 |
5 | $Id: WsbLicenseStore.h 10793 2014-06-25 12:46:08Z jebaseelir $
6 | Original author: John Hwa
7 |
8 | This software is provided to you pursuant to your agreement
9 | with Intertrust Technologies Corporation ("Intertrust").
10 | This software may be used only in accordance with the terms
11 | of the agreement.
12 |
13 | Copyright (c) 2009-2014 by Intertrust. All rights reserved.
14 |
15 ****************************************************************/
21 #ifndef _WSB_LICENSE_STORE_H_
22 #define _WSB_LICENSE_STORE_H_
23 
24 /*----------------------------------------------------------------------
25 | includes
26 +---------------------------------------------------------------------*/
27 #include "ShiData.h"
28 #include "WsbTypes.h"
29 
30 /*----------------------------------------------------------------------
31 | result codes
32 +---------------------------------------------------------------------*/
33 #define WSB_ERROR_LS_PARSE_LICENSE (WSB_ERROR_BASE_LICENSE_STORE - 0)
34 #define WSB_ERROR_LS_CREATE_DIR (WSB_ERROR_BASE_LICENSE_STORE - 1)
35 #define WSB_ERROR_LS_OPEN_DB (WSB_ERROR_BASE_LICENSE_STORE - 2)
36 #define WSB_ERROR_LS_CREATE_TABLES (WSB_ERROR_BASE_LICENSE_STORE - 3)
37 #define WSB_ERROR_LS_ADD_LICENSE (WSB_ERROR_BASE_LICENSE_STORE - 4)
38 #define WSB_ERROR_LS_DUPLICATE_LICENSE (WSB_ERROR_BASE_LICENSE_STORE - 5)
39 #define WSB_ERROR_LS_REMOVE_LICENSE (WSB_ERROR_BASE_LICENSE_STORE - 6)
40 #define WSB_ERROR_LS_FAIL_LOOKUP (WSB_ERROR_BASE_LICENSE_STORE - 7)
41 #define WSB_ERROR_LS_NO_LICENSE (WSB_ERROR_BASE_LICENSE_STORE - 8)
42 #define WSB_ERROR_LS_OWNING_THREAD (WSB_ERROR_BASE_LICENSE_STORE - 9)
43 #define WSB_ERROR_LS_NO_CID (WSB_ERROR_BASE_LICENSE_STORE - 10)
44 #define WSB_ERROR_LS_CLOSE_DB (WSB_ERROR_BASE_LICENSE_STORE - 11)
45 #define WSB_ERROR_LS_VACUUM (WSB_ERROR_BASE_LICENSE_STORE - 12)
46 
47 /*----------------------------------------------------------------------
48 | constants
49 +---------------------------------------------------------------------*/
54 #define WSB_TYPE_ID_LICENSE 1000
55 
61 #define WSB_LS_FLAG_LICENSE_DATA 0x01
62 
63 #define WSB_LS_FLAG_LICENSE_EXPIRE_DATE 0x02
64 
65 #define WSB_LS_FLAG_LICENSE_INSERT_DATE 0x04
66 
67 #define WSB_LS_FLAG_LICENSE_TAG 0x08
68 
69 /*----------------------------------------------------------------------
70 | interfaces
71 +---------------------------------------------------------------------*/
72 #if defined(__cplusplus)
73 extern "C" {
74 #endif
75 
84 typedef struct WSB_License WSB_License;
85 
95 WSB_EXPORT WSB_UInt32
96 WSB_License_GetId(const WSB_License* license);
97 
112 WSB_EXPORT WSB_ByteArray
113 WSB_License_GetData(const WSB_License* license);
114 
128 WSB_EXPORT WSB_Int32
130 
140 WSB_EXPORT WSB_Int32
141 WSB_License_GetPriority(const WSB_License* license);
142 
155 WSB_EXPORT WSB_Int32
157 
170 WSB_EXPORT const char*
171 WSB_License_GetTag(const WSB_License* license);
172 
185 
198 WSB_EXPORT WSB_Result
200 
216 WSB_EXPORT WSB_Result
218  const void* data,
219  WSB_Size data_size,
220  const char* tag,
221  WSB_UInt32* lid);
222 
251 WSB_EXPORT WSB_Result
253  const char** cids,
254  WSB_Cardinal id_count,
255  SHI_Data** licenses);
256 
278 WSB_EXPORT WSB_Result
280  WSB_UInt32 lid,
281  SHI_Data** cids);
282 
302 WSB_EXPORT WSB_Result
304  WSB_UInt32 lid,
305  SHI_Data** license);
306 
334 WSB_EXPORT WSB_Result
336  WSB_Flags flags,
337  SHI_Data** licenses);
338 
358 WSB_EXPORT WSB_Result
360  SHI_Data** cids);
361 
370 WSB_EXPORT WSB_Result
372 
380 WSB_EXPORT WSB_Result
382  WSB_UInt32 lid);
383 
390 WSB_EXPORT WSB_Result
392 
395 #if defined(__cplusplus)
396 }
397 #endif
398 
399 #endif /* _WSB_LICENSE_STORE_H_ */
400 
WSB_EXPORT WSB_Result WSB_LicenseStore_RemoveLicense(WSB_LicenseStore *store, WSB_UInt32 lid)
Removes from the License Store the license with a specified license ID.
struct WSB_LicenseStore WSB_LicenseStore
A WSB_LicenseStore object is used to access the Wasabi License Store in which licenses may be stored...
Definition: WsbLicenseStore.h:184
WSB_EXPORT WSB_Result WSB_LicenseStore_Close(WSB_LicenseStore *store)
Closes the License Store and releases the specified WSB_LicenseStore object referring to it...
WSB_EXPORT WSB_Result WSB_LicenseStore_EnumerateLicenses(WSB_LicenseStore *store, WSB_Flags flags, SHI_Data **licenses)
Obtains from the License Store all licenses.
An untyped array of bytes.
Definition: WsbTypes.h:178
WSB_EXPORT WSB_Result WSB_LicenseStore_ExpungeExpiredLicenses(WSB_LicenseStore *store)
Expunges from the License Store all the expired licenses and vacuums the database.
WSB_EXPORT WSB_Result WSB_LicenseStore_EnumerateContentIds(WSB_LicenseStore *store, SHI_Data **cids)
Obtains from the License Store all content IDs governed by the licenses in the License Store...
WSB_UInt32 WSB_Flags
Type used to represent a bit pattern signifying a combination of flags that can be on or off...
Definition: WsbTypes.h:93
WSB_EXPORT WSB_Result WSB_LicenseStore_GetLicenseById(WSB_LicenseStore *store, WSB_UInt32 lid, SHI_Data **license)
Obtains from the License Store the license with a specified license ID.
WSB_EXPORT WSB_Int32 WSB_License_GetExpirationDate(const WSB_License *license)
Gets the license expiration date for a specified license.
WSB_EXPORT WSB_Result WSB_LicenseStore_Open(WSB_LicenseStore **store)
Opens the License Store and creates a new WSB_LicenseStore object to refer to it. ...
struct WSB_License WSB_License
A WSB_License object represents information about a license.
Definition: WsbLicenseStore.h:84
WSB_EXPORT WSB_Int32 WSB_License_GetPriority(const WSB_License *license)
Gets the license priority for a specified license.
WSB_EXPORT WSB_Result WSB_LicenseStore_FindContentIdsByLicense(WSB_LicenseStore *store, WSB_UInt32 lid, SHI_Data **cids)
Finds in the License Store the content ID(s) governed by the license with the specified license ID...
WSB_EXPORT WSB_ByteArray WSB_License_GetData(const WSB_License *license)
Gets the license data (the bytes representing the license) for a specified license.
WSB_EXPORT WSB_Int32 WSB_License_GetInsertionDate(const WSB_License *license)
Gets the license insertion date (the date it was inserted into the License Store) for a specified lic...
WSB_UInt32 WSB_Cardinal
An unsigned integer used to represent a quantity that can be counted (such as a number of elements in...
Definition: WsbTypes.h:121
int WSB_Result
Signed integer value representing a function or method result (return value).
Definition: WsbTypes.h:83
WSB_EXPORT WSB_UInt32 WSB_License_GetId(const WSB_License *license)
Gets the license ID for a specified license.
unsigned int WSB_UInt32
32-bit (or more) unsigned integer
Definition: WsbTypes.h:36
WSB_EXPORT const char * WSB_License_GetTag(const WSB_License *license)
Gets the license tag for a specified license.
WSB_EXPORT WSB_Result WSB_LicenseStore_AddLicense(WSB_LicenseStore *store, const void *data, WSB_Size data_size, const char *tag, WSB_UInt32 *lid)
Adds a license into the License Store.
struct SHI_Data SHI_Data
A SHI_Data object represents a typed data object.
Definition: EmbProcessor.h:231
signed int WSB_Int32
32-bit (or more) signed integer
Definition: WsbTypes.h:37
Wasabi Result.
WSB_EXPORT WSB_Result WSB_LicenseStore_FindLicensesByContentIds(WSB_LicenseStore *store, const char **cids, WSB_Cardinal id_count, SHI_Data **licenses)
Finds in the License Store the license(s) with specified content ID(s).
Generic Data Objects.
WSB_UInt32 WSB_Size
An unsigned integer used to represent a measurable quantity (e.g., the size of a file).
Definition: WsbTypes.h:104