diff options
author | Benny Prijono <bennylp@teluu.com> | 2011-02-28 07:44:19 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2011-02-28 07:44:19 +0000 |
commit | d62ff46dee0080e4470c03496614245f23c68a2d (patch) | |
tree | 2a6f0fbd7ce92cb34f7ec671f6beff15c0b872e9 /pjlib/include | |
parent | a8f0337ed01c61809d5ff4b0ae026cbae142b697 (diff) |
Initial implementation for re #1202 (PJILB System Information API) for Linux/Unix
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3423 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/include')
-rw-r--r-- | pjlib/include/pj/compat/os_auto.h.in | 2 | ||||
-rw-r--r-- | pjlib/include/pj/config.h | 24 | ||||
-rw-r--r-- | pjlib/include/pj/os.h | 94 |
3 files changed, 120 insertions, 0 deletions
diff --git a/pjlib/include/pj/compat/os_auto.h.in b/pjlib/include/pj/compat/os_auto.h.in index 5c5f74bf..97501a55 100644 --- a/pjlib/include/pj/compat/os_auto.h.in +++ b/pjlib/include/pj/compat/os_auto.h.in @@ -48,6 +48,7 @@ #undef PJ_HAS_CTYPE_H #undef PJ_HAS_ERRNO_H #undef PJ_HAS_FCNTL_H +#undef PJ_HAS_LIMITS_H #undef PJ_HAS_LINUX_SOCKET_H #undef PJ_HAS_MALLOC_H #undef PJ_HAS_NETDB_H @@ -73,6 +74,7 @@ #undef PJ_HAS_SYS_TYPES_H #undef PJ_HAS_SYS_FILIO_H #undef PJ_HAS_SYS_SOCKIO_H +#undef PJ_HAS_SYS_UTSNAME_H #undef PJ_HAS_TIME_H #undef PJ_HAS_UNISTD_H diff --git a/pjlib/include/pj/config.h b/pjlib/include/pj/config.h index bf05cbae..f75a7f34 100644 --- a/pjlib/include/pj/config.h +++ b/pjlib/include/pj/config.h @@ -1119,6 +1119,30 @@ PJ_BEGIN_DECL +/** PJLIB version major number. */ +#define PJ_VERSION_NUM_MAJOR 1 + +/** PJLIB version minor number. */ +#define PJ_VERSION_NUM_MINOR 8 + +/** PJLIB version revision number. */ +#define PJ_VERSION_NUM_REV 10 + +/** + * Extra suffix for the version (e.g. "-trunk"), or empty for + * web release version. + */ +#define PJ_VERSION_NUM_EXTRA "-trunk" + +/** + * PJLIB version number consists of three bytes with the following format: + * 0xMMIIRR00, where MM: major number, II: minor number, RR: revision + * number, 00: always zero for now. + */ +#define PJ_VERSION_NUM ((PJ_VERSION_NUM_MAJOR << 24) | \ + (PJ_VERSION_NUM_MINOR << 16) | \ + (PJ_VERSION_NUM_REV << 8)) + /** * PJLIB version string constant. @see pj_get_version() */ diff --git a/pjlib/include/pj/os.h b/pjlib/include/pj/os.h index e1d3c485..8d50476a 100644 --- a/pjlib/include/pj/os.h +++ b/pjlib/include/pj/os.h @@ -35,6 +35,100 @@ PJ_BEGIN_DECL /* **************************************************************************/ /** + * @defgroup PJ_SYS_INFO System Information + * @ingroup PJ_OS + * @{ + */ + +/** + * These enumeration contains constants to indicate support of miscellaneous + * system features. These will go in "flags" field of #pj_sys_info structure. + */ +typedef enum pj_sys_info_flag +{ + /** + * Support for Apple iOS background feature. + */ + PJ_SYS_HAS_IOS_BG = 1 + +} pj_sys_info_flag; + + +/** + * This structure contains information about the system. Use #pj_get_sys_info() + * to obtain the system information. + */ +typedef struct pj_sys_info +{ + /** + * Null terminated string containing processor information (e.g. "i386", + * "x86_64"). It may contain empty string if the value cannot be obtained. + */ + pj_str_t machine; + + /** + * Null terminated string identifying the system operation (e.g. "Linux", + * "win32", "wince"). It may contain empty string if the value cannot be + * obtained. + */ + pj_str_t os_name; + + /** + * A number containing the operating system version number. By convention, + * this field is divided into four bytes, where the highest order byte + * contains the most major version of the OS, the next less significant + * byte contains the less major version, and so on. How the OS version + * number is mapped into these four bytes would be specific for each OS. + * For example, Linux-2.6.32-28 would yield "os_ver" value of 0x0206201c, + * while for Windows 7 it will be 0x06010000 (because dwMajorVersion is + * 6 and dwMinorVersion is 1 for Windows 7). + * + * This field may contain zero if the OS version cannot be obtained. + */ + pj_uint32_t os_ver; + + /** + * Null terminated string identifying the SDK name that is used to build + * the library (e.g. "glibc", "uclibc", "msvc", "wince"). It may contain + * empty string if the value cannot eb obtained. + */ + pj_str_t sdk_name; + + /** + * A number containing the SDK version, using the numbering convention as + * the "os_ver" field. The value will be zero if the version cannot be + * obtained. + */ + pj_uint32_t sdk_ver; + + /** + * A longer null terminated string identifying the underlying system with + * as much information as possible. + */ + pj_str_t info; + + /** + * Other flags containing system specific information. The value is + * bitmask of #pj_sys_info_flag constants. + */ + pj_uint32_t flags; + +} pj_sys_info; + + +/** + * Obtain the system information. + * + * @return System information structure. + */ +PJ_DECL(const pj_sys_info*) pj_get_sys_info(void); + +/* + * @} + */ + +/* **************************************************************************/ +/** * @defgroup PJ_THREAD Threads * @ingroup PJ_OS * @{ |