Rev 1892 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1892 | Rev 3959 | ||
---|---|---|---|
Line 52... | Line 52... | ||
52 | * Cairo has a three-part version number scheme. In this scheme, we use |
52 | * Cairo has a three-part version number scheme. In this scheme, we use |
53 | * even vs. odd numbers to distinguish fixed points in the software |
53 | * even vs. odd numbers to distinguish fixed points in the software |
54 | * vs. in-progress development, (such as from git instead of a tar file, |
54 | * vs. in-progress development, (such as from git instead of a tar file, |
55 | * or as a "snapshot" tar file as opposed to a "release" tar file). |
55 | * or as a "snapshot" tar file as opposed to a "release" tar file). |
56 | * |
56 | * |
57 | * |
57 | * |
58 | * _____ Major. Always 1, until we invent a new scheme. |
58 | * _____ Major. Always 1, until we invent a new scheme. |
59 | * / ___ Minor. Even/Odd = Release/Snapshot (tar files) or Branch/Head (git) |
59 | * / ___ Minor. Even/Odd = Release/Snapshot (tar files) or Branch/Head (git) |
60 | * | / _ Micro. Even/Odd = Tar-file/git |
60 | * | / _ Micro. Even/Odd = Tar-file/git |
61 | * | | / |
61 | * | | / |
62 | * 1.0.0 |
62 | * 1.0.0 |
63 | * |
63 | * |
64 | * |
64 | * |
65 | * Here are a few examples of versions that one might see. |
65 | * Here are a few examples of versions that one might see. |
66 | * |
66 | * |
67 | * Releases |
67 | * Releases |
68 | * -------- |
68 | * -------- |
69 | * 1.0.0 - A major release |
69 | * 1.0.0 - A major release |
70 | * 1.0.2 - A subsequent maintenance release |
70 | * 1.0.2 - A subsequent maintenance release |
71 | * 1.2.0 - Another major release |
71 | * 1.2.0 - Another major release |
72 | * |
72 | * |
73 | * Snapshots |
73 | * Snapshots |
74 | * --------- |
74 | * --------- |
75 | * 1.1.2 - A snapshot (working toward the 1.2.0 release) |
75 | * 1.1.2 - A snapshot (working toward the 1.2.0 release) |
76 | * |
76 | * |
77 | * In-progress development (eg. from git) |
77 | * In-progress development (eg. from git) |
78 | * -------------------------------------- |
78 | * -------------------------------------- |
79 | * 1.0.1 - Development on a maintenance branch (toward 1.0.2 release) |
79 | * 1.0.1 - Development on a maintenance branch (toward 1.0.2 release) |
80 | * 1.1.1 - Development on head (toward 1.1.2 snapshot and 1.2.0 release) |
80 | * 1.1.1 - Development on head (toward 1.1.2 snapshot and 1.2.0 release) |
81 | * |
81 | * |
82 | * |
82 | * |
83 | * |
83 | * |
84 | * |
84 | * |
85 | * |
85 | * |
86 | * The API/ABI compatibility guarantees for various versions are as |
86 | * The API/ABI compatibility guarantees for various versions are as |
Line 110... | Line 110... | ||
110 | * Cairo provides the ability to examine the version at either |
110 | * Cairo provides the ability to examine the version at either |
111 | * compile-time or run-time and in both a human-readable form as well as |
111 | * compile-time or run-time and in both a human-readable form as well as |
112 | * an encoded form suitable for direct comparison. Cairo also provides the |
112 | * an encoded form suitable for direct comparison. Cairo also provides the |
113 | * macro CAIRO_VERSION_ENCODE() to perform the encoding. |
113 | * macro CAIRO_VERSION_ENCODE() to perform the encoding. |
114 | * |
114 | * |
115 | * |
115 | * |
116 | * Compile-time |
116 | * Compile-time |
117 | * ------------ |
117 | * ------------ |
118 | * CAIRO_VERSION_STRING Human-readable |
118 | * CAIRO_VERSION_STRING Human-readable |
119 | * CAIRO_VERSION Encoded, suitable for comparison |
119 | * CAIRO_VERSION Encoded, suitable for comparison |
120 | * |
120 | * |
121 | * Run-time |
121 | * Run-time |
122 | * -------- |
122 | * -------- |
123 | * cairo_version_string() Human-readable |
123 | * cairo_version_string() Human-readable |
124 | * cairo_version() Encoded, suitable for comparison |
124 | * cairo_version() Encoded, suitable for comparison |
125 | * |
125 | * |
126 | * |
126 | * |
127 | * For example, checking that the cairo version is greater than or equal |
127 | * For example, checking that the cairo version is greater than or equal |
128 | * to 1.0.0 could be achieved at compile-time or run-time as follows: |
128 | * to 1.0.0 could be achieved at compile-time or run-time as follows: |
129 | * |
129 | * |
130 | * |
130 | * |
Line 135... | Line 135... | ||
135 | * if (cairo_version() >= CAIRO_VERSION_ENCODE(1, 0, 0)) |
135 | * if (cairo_version() >= CAIRO_VERSION_ENCODE(1, 0, 0)) |
136 | * printf ("Running with suitable cairo version: %s\n", cairo_version_string ()); |
136 | * printf ("Running with suitable cairo version: %s\n", cairo_version_string ()); |
137 | * |
137 | * |
138 | * |
138 | * |
139 | * |
139 | * |
140 | */ |
140 | **/ |
Line 141... | Line 141... | ||
141 | 141 | ||
142 | /** |
142 | /** |
143 | * CAIRO_VERSION: |
143 | * CAIRO_VERSION: |
144 | * |
144 | * |
145 | * The version of cairo available at compile-time, encoded using |
145 | * The version of cairo available at compile-time, encoded using |
- | 146 | * CAIRO_VERSION_ENCODE(). |
|
- | 147 | * |
|
146 | * CAIRO_VERSION_ENCODE(). |
148 | * Since: 1.0 |
Line 147... | Line 149... | ||
147 | */ |
149 | **/ |
148 | 150 | ||
149 | /** |
151 | /** |
150 | * CAIRO_VERSION_MAJOR: |
152 | * CAIRO_VERSION_MAJOR: |
- | 153 | * |
|
- | 154 | * The major component of the version of cairo available at compile-time. |
|
151 | * |
155 | * |
Line 152... | Line 156... | ||
152 | * The major component of the version of cairo available at compile-time. |
156 | * Since: 1.0 |
153 | */ |
157 | **/ |
154 | 158 | ||
155 | /** |
159 | /** |
- | 160 | * CAIRO_VERSION_MINOR: |
|
- | 161 | * |
|
156 | * CAIRO_VERSION_MINOR: |
162 | * The minor component of the version of cairo available at compile-time. |
Line 157... | Line 163... | ||
157 | * |
163 | * |
158 | * The minor component of the version of cairo available at compile-time. |
164 | * Since: 1.0 |
159 | */ |
165 | **/ |
160 | 166 | ||
- | 167 | /** |
|
- | 168 | * CAIRO_VERSION_MICRO: |
|
161 | /** |
169 | * |
Line 162... | Line 170... | ||
162 | * CAIRO_VERSION_MICRO: |
170 | * The micro component of the version of cairo available at compile-time. |
163 | * |
171 | * |
164 | * The micro component of the version of cairo available at compile-time. |
172 | * Since: 1.0 |
165 | */ |
173 | **/ |
166 | 174 | ||
- | 175 | /** |
|
- | 176 | * CAIRO_VERSION_STRING: |
|
167 | /** |
177 | * |
Line 168... | Line 178... | ||
168 | * CAIRO_VERSION_STRING: |
178 | * A human-readable string literal containing the version of cairo available |
169 | * |
179 | * at compile-time, in the form of "X.Y.Z". |
170 | * A human-readable string literal containing the version of cairo available |
180 | * |
171 | * at compile-time, in the form of "X.Y.Z". |
181 | * Since: 1.8 |
Line 180... | Line 190... | ||
180 | * This macro encodes the given cairo version into an integer. The numbers |
190 | * This macro encodes the given cairo version into an integer. The numbers |
181 | * returned by %CAIRO_VERSION and cairo_version() are encoded using this macro. |
191 | * returned by %CAIRO_VERSION and cairo_version() are encoded using this macro. |
182 | * Two encoded version numbers can be compared as integers. The encoding ensures |
192 | * Two encoded version numbers can be compared as integers. The encoding ensures |
183 | * that later versions compare greater than earlier versions. |
193 | * that later versions compare greater than earlier versions. |
184 | * |
194 | * |
185 | * @Returns: the encoded version. |
195 | * Returns: the encoded version. |
- | 196 | * |
|
- | 197 | * Since: 1.0 |
|
186 | */ |
198 | **/ |
Line 187... | Line 199... | ||
187 | 199 | ||
188 | /** |
200 | /** |
189 | * CAIRO_VERSION_STRINGIZE: |
201 | * CAIRO_VERSION_STRINGIZE: |
190 | * @major: the major component of the version number |
202 | * @major: the major component of the version number |
Line 193... | Line 205... | ||
193 | * |
205 | * |
194 | * This macro encodes the given cairo version into an string. The numbers |
206 | * This macro encodes the given cairo version into an string. The numbers |
195 | * returned by %CAIRO_VERSION_STRING and cairo_version_string() are encoded using this macro. |
207 | * returned by %CAIRO_VERSION_STRING and cairo_version_string() are encoded using this macro. |
196 | * The parameters to this macro must expand to numerical literals. |
208 | * The parameters to this macro must expand to numerical literals. |
197 | * |
209 | * |
198 | * @Returns: a string literal containing the version. |
210 | * Returns: a string literal containing the version. |
199 | * |
211 | * |
200 | * @Since: 1.8 |
212 | * Since: 1.8 |
201 | */ |
213 | **/ |
Line 202... | Line 214... | ||
202 | 214 | ||
203 | /** |
215 | /** |
204 | * cairo_version: |
216 | * cairo_version: |
205 | * |
217 | * |
Line 216... | Line 228... | ||
216 | * |
228 | * |
217 | * See also cairo_version_string() as well as the compile-time |
229 | * See also cairo_version_string() as well as the compile-time |
218 | * equivalents %CAIRO_VERSION and %CAIRO_VERSION_STRING. |
230 | * equivalents %CAIRO_VERSION and %CAIRO_VERSION_STRING. |
219 | * |
231 | * |
220 | * Return value: the encoded version. |
232 | * Return value: the encoded version. |
- | 233 | * |
|
- | 234 | * Since: 1.0 |
|
221 | **/ |
235 | **/ |
222 | int |
236 | int |
223 | cairo_version (void) |
237 | cairo_version (void) |
224 | { |
238 | { |
225 | return CAIRO_VERSION; |
239 | return CAIRO_VERSION; |
Line 233... | Line 247... | ||
233 | * |
247 | * |
234 | * See also cairo_version() as well as the compile-time equivalents |
248 | * See also cairo_version() as well as the compile-time equivalents |
235 | * %CAIRO_VERSION_STRING and %CAIRO_VERSION. |
249 | * %CAIRO_VERSION_STRING and %CAIRO_VERSION. |
236 | * |
250 | * |
237 | * Return value: a string containing the version. |
251 | * Return value: a string containing the version. |
- | 252 | * |
|
- | 253 | * Since: 1.0 |
|
238 | **/ |
254 | **/ |
239 | const char* |
255 | const char* |
240 | cairo_version_string (void) |
256 | cairo_version_string (void) |
241 | { |
257 | { |
242 | return CAIRO_VERSION_STRING; |
258 | return CAIRO_VERSION_STRING; |