NetServices: Add libnetservices2.a from dev/netservices into master

The overall design does not deviate much from my proof of concept [2] and that still makes a good read to
understanding the overall architecture. If you want to get a sense of how it is built up, the API comes with
full doxygen documentation for the public API [3], and I have also done a PoC change for HaikuDepot which is
useful as an illustration on what the impact for the user of the new library is. [4] There is also a test suite
that may give some insight into the day to day ergonomics of the API [5].

The current state is that I am fairly confident that many HTTP requests will actually work, but I do expect
rough edges with a protocol with this many diverse implementations. There is also a list of features yet to be
implemented on Trac [6]. Additionally, I still want/need to do performance testing.

The goal of merging the kit right now is to start making it available for more uses, and through that also give
a chance to shape its future. There are also some design decisions that need review, most notably I expect some
discussion around the uses of C++ 17 idioms (like std::optional and std::string_view) and around the use of
exceptions for error handling.

The impact of merging right now should be near zero: the netservices2 kit lives in its own header space, and
builds into its own static library (libnetservices2.a). It is not yet used in any of the apps in our
repository.

The branch does remove the deprecated services kit from the libnetapi.so library, though it leaves
libnetservices.a intact. After our previous announcement to remove it after beta 3, this should be expected.

[2] https://github.com/nielx/haiku-netservices-rfc/tree/exceptions
[3] https://git.haiku-os.org/haiku/tree/docs/user/netservices?h=dev/netservices
[4] https://review.haiku-os.org/c/haiku/+/5692
[5] https://git.haiku-os.org/haiku/tree/src/tests/kits/net/netservices2?h=dev/netservices
[6] https://dev.haiku-os.org/wiki/Development/NetServices2

Change-Id: I5d0b7e2619699f39a2506588417b57391f0f5cc2
This commit is contained in:
Niels Sascha Reedijk
2022-11-02 01:37:17 +00:00
18 changed files with 115 additions and 101 deletions
+5 -1
View File
@@ -239,8 +239,12 @@ enum {
B_USE_WINDOW_INSETS = B_USE_WINDOW_SPACING,
B_USE_SMALL_SPACING = -1006,
B_USE_SMALL_INSETS = B_USE_SMALL_SPACING,
B_USE_BIG_SPACING = -1007,
B_USE_CORNER_SPACING = -1007,
B_USE_CORNER_INSETS = B_USE_CORNER_SPACING,
B_USE_BIG_SPACING = -1008,
B_USE_BIG_INSETS = B_USE_BIG_SPACING,
B_USE_BORDER_SPACING = -1009,
B_USE_BORDER_INSETS = B_USE_BORDER_SPACING,
};
@@ -337,8 +337,6 @@ public:
uint32 flags = 0,
uint32 borders = B_ALL_BORDERS,
orientation orientation = B_HORIZONTAL);
virtual float GetScrollBarWidth(
orientation orientation = B_VERTICAL);
protected:
void _DrawButtonFrame(BView* view, BRect& rect,
@@ -356,8 +356,8 @@ public:
inline Element* RemoveHead();
inline Element* RemoveTail();
inline Element* GetPrevious(Element* element) const;
inline Element* GetNext(Element* element) const;
static inline Element* GetPrevious(Element* element);
static inline Element* GetNext(Element* element);
inline bool Contains(Element* element) const;
// O(n)!
@@ -605,7 +605,7 @@ DOUBLY_LINKED_LIST_CLASS_NAME::RemoveTail()
// GetPrevious
DOUBLY_LINKED_LIST_TEMPLATE_LIST
Element*
DOUBLY_LINKED_LIST_CLASS_NAME::GetPrevious(Element* element) const
DOUBLY_LINKED_LIST_CLASS_NAME::GetPrevious(Element* element)
{
Element* result = NULL;
if (element)
@@ -616,7 +616,7 @@ DOUBLY_LINKED_LIST_CLASS_NAME::GetPrevious(Element* element) const
// GetNext
DOUBLY_LINKED_LIST_TEMPLATE_LIST
Element*
DOUBLY_LINKED_LIST_CLASS_NAME::GetNext(Element* element) const
DOUBLY_LINKED_LIST_CLASS_NAME::GetNext(Element* element)
{
Element* result = NULL;
if (element)