stumpless 2.2.0
载入中...
搜索中...
未找到
version.h 文件参考

Runtime information about the library. 更多...

浏览该文件的源代码.

结构体

struct  stumpless_version
 A description of a library version. 更多...
 

函数

struct stumpless_versionstumpless_get_version (void)
 Gets the version of code the library was built with.
 
int stumpless_version_cmp (const struct stumpless_version *version_x, const struct stumpless_version *version_y)
 Compares the version of two given stumpless_version struct.
 
char * stumpless_version_to_string (const struct stumpless_version *version)
 Creates a string representation of the given version.
 

详细描述

Runtime information about the library.

函数说明

◆ stumpless_get_version()

struct stumpless_version * stumpless_get_version ( void )

Gets the version of code the library was built with.

This version must be freed by the caller when it is no longer needed to avoid a memory leak.

Thread Safety: MT-Safe This function is thread safe.

Async Signal Safety: AS-Unsafe heap This function is not safe to call from signal handlers due to the use of memory management functions to create the version structure.

Async Cancel Safety: AC-Unsafe heap This function is not safe to call from threads that may be asynchronously cancelled, due to the use of memory management functions.

返回
The version of code used by the library build.

◆ stumpless_version_cmp()

int stumpless_version_cmp ( const struct stumpless_version * version_x,
const struct stumpless_version * version_y )

Compares the version of two given stumpless_version struct.

This function makes use of a similar convention used by the standard library's strcmp function.

Thread Safety: MT-Safe race:version_x race:version_y This function is thread safe, as long as the versions to be compared are not modified by other threads during the call.

Async Signal Safety: AS-Safe This function is safe to call from signal handlers.

Async Cancel Safety: AC-Safe This function is safe to call from threads that may be asynchronously cancelled.

参数
version_x,version_yTwo given version(const) to be compared.
返回
0 if version numbers are the same,
1 if version_x->patch - version_y->patch > 0, -1 if < 0
10 if version_x->minor - version_y->minor > 0, -10 if < 0
100 if version_x->major - version_y->major > 0, -100 if < 0
INT_MAX if one of the version pointers is null.

◆ stumpless_version_to_string()

char * stumpless_version_to_string ( const struct stumpless_version * version)

Creates a string representation of the given version.

This string will be NULL-terminated, and will appear in the standard semantic versioning format of 'major.minor.patch'.

This string must be freed by the caller when it is no longer needed. Failing to do so will result in a memory leak of the returned string.

Thread Safety: MT-Safe race:version This function is thread safe, as long as the version is not modified by other threads during the call.

Async Signal Safety: AS-Safe This function is safe to call from signal handlers.

Async Cancel Safety: AC-Safe This function is safe to call from threads that may be asynchronously cancelled.

参数
versionThe version to convert to a string.
返回
A string representation of the provided version. This should be destroyed via the memory deallocation function currently configured via stumpless_set_free(). If an error is encountered, then NULL is returned and an error code is set appropriately.