Projects
osmocom:master
libosmocore
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 292
View file
libosmocore.spec
Changed
@@ -14,13 +14,13 @@ Name: libosmocore Requires: osmocom-master -Version: 1.9.0.109.b8f3 +Version: 1.9.0.111.0f59 Release: 0 Summary: The Open Source Mobile Communications Core Library License: GPL-2.0-only AND GPL-2.0-or-later AND LGPL-2.1-or-later AND AGPL-3.0-or-later Group: Productivity/Telephony/Utilities Url: https://osmocom.org/projects/libosmocore/wiki/Libosmocore -Source: libosmocore_1.9.0.109.b8f3.tar.xz +Source: libosmocore_1.9.0.111.0f59.tar.xz Source1: rpmlintrc BuildRequires: automake >= 1.6 BuildRequires: libtool >= 2
View file
commit_0f59cebf081edc20d8a7b19cb799810446fc2ab3.txt
Added
View file
commit_b8f3bba72174e057bf7504db6f6e0999b35633d7.txt
Deleted
View file
libosmocore_1.9.0.109.b8f3.dsc -> libosmocore_1.9.0.111.0f59.dsc
Changed
@@ -2,7 +2,7 @@ Source: libosmocore Binary: libosmocore, libosmocodec4, libosmocodec-doc, libosmocoding0, libosmocoding-doc, libosmocore21, libosmocore-doc, libosmogb14, libosmogb-doc, libosmogsm20, libosmogsm-doc, libosmoisdn0, libosmoisdn-doc, libosmovty13, libosmovty-doc, libosmoctrl0, libosmoctrl-doc, libosmosim2, libosmosim-doc, libosmousb0, libosmousb-doc, libosmocore-dev, libosmocore-utils, libosmocore-dbg Architecture: any all -Version: 1.9.0.109.b8f3 +Version: 1.9.0.111.0f59 Maintainer: Osmocom team <openbsc@lists.osmocom.org> Homepage: https://projects.osmocom.org/projects/libosmocore Standards-Version: 3.9.8 @@ -35,8 +35,8 @@ libosmovty-doc deb doc optional arch=all libosmovty13 deb libs optional arch=any Checksums-Sha1: - fe673fd9459f586747fd089d1d228608ff071694 1091720 libosmocore_1.9.0.109.b8f3.tar.xz + 46c01a836fb628136a0ab3b3317e2b7f148d3644 1091672 libosmocore_1.9.0.111.0f59.tar.xz Checksums-Sha256: - 9484977bbc464010fc1825cc8948683b93e7ba0d92420cd6d6ef185287701133 1091720 libosmocore_1.9.0.109.b8f3.tar.xz + 7c252d1f8ef541b69080a24321465d1f3192bafdae1415a2db37f47ae02bc989 1091672 libosmocore_1.9.0.111.0f59.tar.xz Files: - 27b8aec34c88dce100451cee6390e5ee 1091720 libosmocore_1.9.0.109.b8f3.tar.xz + f4f4187a83090439c6137d9e92aa4010 1091672 libosmocore_1.9.0.111.0f59.tar.xz
View file
libosmocore_1.9.0.109.b8f3.tar.xz/.tarball-version -> libosmocore_1.9.0.111.0f59.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.9.0.109-b8f3 +1.9.0.111-0f59
View file
libosmocore_1.9.0.109.b8f3.tar.xz/debian/changelog -> libosmocore_1.9.0.111.0f59.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -libosmocore (1.9.0.109.b8f3) unstable; urgency=medium +libosmocore (1.9.0.111.0f59) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom master feed - -- Osmocom OBS scripts <info@osmocom.org> Fri, 29 Dec 2023 17:57:27 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Sat, 30 Dec 2023 16:17:38 +0000 libosmocore (1.9.0) unstable; urgency=medium
View file
libosmocore_1.9.0.109.b8f3.tar.xz/include/osmocom/core/utils.h -> libosmocore_1.9.0.111.0f59.tar.xz/include/osmocom/core/utils.h
Changed
@@ -281,14 +281,37 @@ #define OSMO_STRBUF_PRINTF(STRBUF, fmt, args...) \ OSMO_STRBUF_APPEND(STRBUF, snprintf, fmt, ##args) +/*! Get remaining space for characters and terminating nul in the given struct osmo_strbuf. + * \paramin sb the string buffer to get the remaining space for. + * \returns remaining space in the given struct osmo_strbuf. */ +static inline size_t _osmo_strbuf_remain(const struct osmo_strbuf *sb) +{ + if (OSMO_UNLIKELY(sb == NULL || sb->buf == NULL)) + return 0; + if (sb->pos == NULL) + return sb->len; + return sb->len - (sb->pos - sb->buf); +} + /*! Return remaining space for characters and terminating nul in the given struct osmo_strbuf. */ -#define OSMO_STRBUF_REMAIN(STRBUF) ((STRBUF).buf ? (STRBUF).len - ((STRBUF).pos - (STRBUF).buf) : 0) +#define OSMO_STRBUF_REMAIN(STRBUF) \ + _osmo_strbuf_remain(&(STRBUF)) + +/*! Get number of actual characters (without terminating nul) in the given struct osmo_strbuf. + * \paramin sb the string buffer to get the number of characters for. + * \returns number of actual characters (without terminating nul). */ +static inline size_t _osmo_strbuf_char_count(const struct osmo_strbuf *sb) +{ + if (OSMO_UNLIKELY(sb == NULL || sb->buf == NULL)) + return 0; + if (sb->pos == NULL || sb->pos <= sb->buf) + return 0; + return OSMO_MIN(sb->pos - sb->buf, sb->len - 1); +} /*! Return number of actual characters contained in struct osmo_strbuf (without terminating nul). */ -#define OSMO_STRBUF_CHAR_COUNT(STRBUF) ((STRBUF).buf && ((STRBUF).pos > (STRBUF).buf) ? \ - OSMO_MIN((STRBUF).pos - (STRBUF).buf, \ - (STRBUF).len - 1) \ - : 0) +#define OSMO_STRBUF_CHAR_COUNT(STRBUF) \ + _osmo_strbuf_char_count(&(STRBUF)) /*! Like OSMO_STRBUF_APPEND(), but for function signatures that return the char* buffer instead of a length. * When using this function, the final STRBUF.chars_needed may not reflect the actual number of characters needed, since
View file
libosmocore_1.9.0.109.b8f3.tar.xz/tests/utils/utils_test.c -> libosmocore_1.9.0.111.0f59.tar.xz/tests/utils/utils_test.c
Changed
@@ -1351,6 +1351,23 @@ strbuf_test_tail_for_buflen(1); } +void strbuf_test_remain_char_count(void) +{ + char buf20; + struct osmo_strbuf sb = { .buf = buf, .len = sizeof(buf) }; + + printf("\n%s\n", __func__); + + printf("remaining space: %zu\n", OSMO_STRBUF_REMAIN(sb)); + printf("current char count: %zu\n", OSMO_STRBUF_CHAR_COUNT(sb)); + + printf("populating the buffer\n"); + OSMO_STRBUF_PRINTF(sb, "osmocom"); + + printf("remaining space: %zu\n", OSMO_STRBUF_REMAIN(sb)); + printf("current char count: %zu\n", OSMO_STRBUF_CHAR_COUNT(sb)); +} + static void startswith_test_str(const char *str, const char *startswith_str, bool expect_rc) { bool rc = osmo_str_startswith(str, startswith_str); @@ -2198,6 +2215,7 @@ strbuf_test(); strbuf_test_nolen(); strbuf_test_tail(); + strbuf_test_remain_char_count(); startswith_test(); name_c_impl_test(); osmo_print_n_test();
View file
libosmocore_1.9.0.109.b8f3.tar.xz/tests/utils/utils_test.ok -> libosmocore_1.9.0.111.0f59.tar.xz/tests/utils/utils_test.ok
Changed
@@ -524,6 +524,13 @@ 6: "" sb.chars_needed=6 sb.pos=&sb.buf1 7: "" sb.chars_needed=12 sb.pos=&sb.buf1 +strbuf_test_remain_char_count +remaining space: 20 +current char count: 0 +populating the buffer +remaining space: 13 +current char count: 7 + startswith_test() osmo_str_startswith(NULL, NULL) == true osmo_str_startswith("", NULL) == true
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.