Change in libosmocore[master]: add to osmo_sock_get_name*() API

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Mon Dec 17 13:50:10 UTC 2018


Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/12268 )

Change subject: add to osmo_sock_get_name*() API
......................................................................


Patch Set 1:

(3 comments)

https://gerrit.osmocom.org/#/c/12268/1/include/osmocom/core/socket.h
File include/osmocom/core/socket.h:

https://gerrit.osmocom.org/#/c/12268/1/include/osmocom/core/socket.h@63
PS1, Line 63: const char *osmo_sock_get_name2(int fd);
> what about osmo_sock_get_name_static()?
we have many other _get_name() functions that return strings in a static buffer (also sometimes in a buffer that belongs to the struct or is part of a value_string[]). This was the exception, so to me it feels right to imply 'static'.


https://gerrit.osmocom.org/#/c/12268/1/include/osmocom/core/socket.h@64
PS1, Line 64: int osmo_sock_get_name2_buf(char *str, size_t str_len, int fd);
> no need to have a 2 here.
there is a 2? You mean it should be in the end instead?

The right way would be to call it osmo_sock_get_name_buf() since it's the first signature with this name, but that would confuse with the semantics of osmo_sock_get_name(). I think osmo_sock_get_name2_buf() shows that it intimately belongs to osmo_sock_get_name2() and that we don't need to go looking for a first API version of it. But feel free to request a different name.


https://gerrit.osmocom.org/#/c/12268/1/src/socket.c
File src/socket.c:

https://gerrit.osmocom.org/#/c/12268/1/src/socket.c@796
PS1, Line 796:  *  \param[out] str  Destination string buffer.
> 2 whitespace here and in next line.
you mean the indent? I'm just copying the scheme I find around here. I think it's rather weird to indent twice for \param, but that's what this file does, probably because most just have a summary doc and line up with '/*!'.

Or do you mean the 2xspace in '\param foo  The foo'? I always do that to set apart the argument name from its actual explanation, since doxygen format lacks a ':' that I would like to put there instead.



-- 
To view, visit https://gerrit.osmocom.org/12268
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I8ad89ac447c9c582742e70d082072bdd40a5a398
Gerrit-Change-Number: 12268
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Comment-Date: Mon, 17 Dec 2018 13:50:10 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181217/f8fd8131/attachment.htm>


More information about the gerrit-log mailing list