blob: f27c557ae4d7ab2191b126d221d4bc8466688580
1 | /* ***** BEGIN LICENSE BLOCK ***** |
2 | * Source last modified: $Id: rm_property.h,v 1.1.1.1.2.1 2005/05/04 18:20:57 hubbe Exp $ |
3 | * |
4 | * REALNETWORKS CONFIDENTIAL--NOT FOR DISTRIBUTION IN SOURCE CODE FORM |
5 | * Portions Copyright (c) 1995-2005 RealNetworks, Inc. |
6 | * All Rights Reserved. |
7 | * |
8 | * The contents of this file, and the files included with this file, |
9 | * are subject to the current version of the Real Format Source Code |
10 | * Porting and Optimization License, available at |
11 | * https://helixcommunity.org/2005/license/realformatsource (unless |
12 | * RealNetworks otherwise expressly agrees in writing that you are |
13 | * subject to a different license). You may also obtain the license |
14 | * terms directly from RealNetworks. You may not use this file except |
15 | * in compliance with the Real Format Source Code Porting and |
16 | * Optimization License. There are no redistribution rights for the |
17 | * source code of this file. Please see the Real Format Source Code |
18 | * Porting and Optimization License for the rights, obligations and |
19 | * limitations governing use of the contents of the file. |
20 | * |
21 | * RealNetworks is the developer of the Original Code and owns the |
22 | * copyrights in the portions it created. |
23 | * |
24 | * This file, and the files included with this file, is distributed and |
25 | * made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, |
26 | * EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL |
27 | * SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF |
28 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT |
29 | * OR NON-INFRINGEMENT. |
30 | * |
31 | * Technology Compatibility Kit Test Suite(s) Location: |
32 | * https://rarvcode-tck.helixcommunity.org |
33 | * |
34 | * Contributor(s): |
35 | * |
36 | * ***** END LICENSE BLOCK ***** */ |
37 | |
38 | #ifndef RM_PROPERTY_H |
39 | #define RM_PROPERTY_H |
40 | |
41 | #include "helix_types.h" |
42 | |
43 | #define RM_PROPERTY_TYPE_UINT32 0 |
44 | #define RM_PROPERTY_TYPE_BUFFER 1 |
45 | #define RM_PROPERTY_TYPE_CSTRING 2 |
46 | |
47 | #ifdef __cplusplus |
48 | extern "C" { |
49 | #endif /* #ifdef __cplusplus */ |
50 | |
51 | /* |
52 | * Property struct |
53 | * |
54 | * This struct can hold a UINT32 property, a CString |
55 | * property, or a buffer property. The members |
56 | * of this struct are as follows: |
57 | * |
58 | * pName: NULL-terminated string which holds the name |
59 | * ulType: This can be either RM_PROPERTY_TYPE_UINT32, |
60 | * RM_PROPERTY_TYPE_BUFFER, or RM_PROPERTY_TYPE_CSTRING. |
61 | * pValue and ulValueLen: |
62 | * 1) For type RM_PROPERTY_TYPE_UINT32, the value is held in |
63 | * the pValue pointer itself and ulValueLen is 0. |
64 | * 2) For type RM_PROPERTY_TYPE_BUFFER, the value is held in |
65 | * the buffer pointed to by pValue and the length of |
66 | * the buffer is ulValueLen. |
67 | * 3) For type RM_PROPERTY_TYPE_CSTRING, the value is a |
68 | * NULL terminated string in pValue. Therefore the pValue |
69 | * pointer can be re-cast as a (const char*) and the value |
70 | * string read from it. ulValueLen holds a length that |
71 | * is AT LEAST strlen((const char*) pValue) + 1. It may |
72 | * be more than that, so do not rely on ulValueLen being |
73 | * equal to strlen((const char*) pValue) + 1. |
74 | */ |
75 | |
76 | typedef struct rm_property_struct { |
77 | char* pName; |
78 | UINT32 ulType; |
79 | BYTE* pValue; |
80 | UINT32 ulValueLen; |
81 | } rm_property; |
82 | |
83 | /* |
84 | * rm_property Accessor Functions |
85 | * |
86 | * Users are strongly encouraged to use these accessor |
87 | * functions to retrieve information from the |
88 | * rm_property struct, since the definition of rm_property |
89 | * may change in the future. |
90 | * |
91 | * When retrieving the property name, the user should first |
92 | * call rm_property_get_name_length() to see that the name |
93 | * length is greater than 0. After that, the user can get |
94 | * read-only access to the name by calling rm_property_get_name(). |
95 | */ |
96 | const char* rm_property_get_name(rm_property* prop); |
97 | UINT32 rm_property_get_type(rm_property* prop); |
98 | UINT32 rm_property_get_value_uint32(rm_property* prop); |
99 | const char* rm_property_get_value_cstring(rm_property* prop); |
100 | UINT32 rm_property_get_value_buffer_length(rm_property* prop); |
101 | BYTE* rm_property_get_value_buffer(rm_property* prop); |
102 | |
103 | #ifdef __cplusplus |
104 | } |
105 | #endif /* #ifdef __cplusplus */ |
106 | |
107 | #endif /* #ifndef RM_PROPERTY_H */ |
108 |