1 /* 2 * Copyright 2019 The libgav1 Authors 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef LIBGAV1_SRC_GAV1_VERSION_H_ 18 #define LIBGAV1_SRC_GAV1_VERSION_H_ 19 20 #include "gav1/symbol_visibility.h" 21 22 // This library follows the principles described by Semantic Versioning 23 // (https://semver.org). 24 25 #define LIBGAV1_MAJOR_VERSION 0 26 #define LIBGAV1_MINOR_VERSION 16 27 #define LIBGAV1_PATCH_VERSION 3 28 29 #define LIBGAV1_VERSION \ 30 ((LIBGAV1_MAJOR_VERSION << 16) | (LIBGAV1_MINOR_VERSION << 8) | \ 31 LIBGAV1_PATCH_VERSION) 32 33 #if defined(__cplusplus) 34 extern "C" { 35 #endif 36 37 // Returns the library's version number, packed in an int using 8 bits for 38 // each of major/minor/patch. e.g, 1.2.3 is 0x010203. 39 LIBGAV1_PUBLIC int Libgav1GetVersion(void); 40 41 // Returns the library's version number as a string in the format 42 // 'MAJOR.MINOR.PATCH'. Always returns a valid (non-NULL) string. 43 LIBGAV1_PUBLIC const char* Libgav1GetVersionString(void); 44 45 // Returns the build configuration used to produce the library. Always returns 46 // a valid (non-NULL) string. 47 LIBGAV1_PUBLIC const char* Libgav1GetBuildConfiguration(void); 48 49 #if defined(__cplusplus) 50 } // extern "C" 51 52 namespace libgav1 { 53 54 // Returns the library's version number, packed in an int using 8 bits for 55 // each of major/minor/patch. e.g, 1.2.3 is 0x010203. GetVersion()56inline int GetVersion() { return Libgav1GetVersion(); } 57 58 // Returns the library's version number as a string in the format 59 // 'MAJOR.MINOR.PATCH'. Always returns a valid (non-NULL) string. GetVersionString()60inline const char* GetVersionString() { return Libgav1GetVersionString(); } 61 62 // Returns the build configuration used to produce the library. Always returns 63 // a valid (non-NULL) string. GetBuildConfiguration()64inline const char* GetBuildConfiguration() { 65 return Libgav1GetBuildConfiguration(); 66 } 67 68 } // namespace libgav1 69 #endif // defined(__cplusplus) 70 71 #endif // LIBGAV1_SRC_GAV1_VERSION_H_ 72