Skip to content

Commit

Permalink
Remove deprecated nng_pipe_getopt and friends.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdamore committed Oct 6, 2024
1 parent 03b701c commit bdbc936
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 241 deletions.
1 change: 0 additions & 1 deletion docs/man/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ if (NNG_ENABLE_DOC)
nng_pipe_close
nng_pipe_dialer
nng_pipe_get
nng_pipe_getopt
nng_pipe_id
nng_pipe_listener
nng_pipe_notify
Expand Down
1 change: 0 additions & 1 deletion docs/man/libnng.3.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ Listeners accept incoming connection requests, and dialers make them.
|xref:nng_pipe_close.3.adoc[nng_pipe_close()]|close pipe
|xref:nng_pipe_dialer.3.adoc[nng_pipe_dialer()]|return dialer that created pipe
|xref:nng_pipe_get.3.adoc[nng_pipe_get()]|get pipe option
|xref:nng_pipe_getopt.3.adoc[nng_pipe_getopt()]|get pipe option
|xref:nng_pipe_id.3.adoc[nng_pipe_id()]|get numeric pipe identifier
|xref:nng_pipe_listener.3.adoc[nng_pipe_listener()]|return listener that created pipe
|xref:nng_pipe_notify.3.adoc[nng_pipe_notify()]|register pipe notification callback
Expand Down
1 change: 0 additions & 1 deletion docs/man/nng_getopt.3.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ These functions return 0 on success, and non-zero otherwise.
[.text-left]
xref:nng_dialer_getopt.3.adoc[nng_dialer_getopt(3)],
xref:nng_listener_getopt.3.adoc[nng_listener_getopt(3)],
xref:nng_pipe_getopt.3.adoc[nng_pipe_getopt(3)],
xref:nng_setopt.3.adoc[nng_setopt(3)],
xref:nng_strdup.3.adoc[nng_strdup(3)],
xref:nng_strerror.3.adoc[nng_strerror(3)],
Expand Down
4 changes: 2 additions & 2 deletions docs/man/nng_msg_get_pipe.3.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The most usual use case for this is to obtain information about the peer
from which the message was received.
This can be used to provide different behaviors for different peers, such as
a higher level of authentication for peers located on an untrusted network.
The xref:nng_pipe_getopt.3.adoc[`nng_pipe_getopt()`] function
The xref:nng_pipe_get.3.adoc[`nng_pipe_get()`] function
is useful in this situation.


Expand All @@ -56,5 +56,5 @@ None.
[.text-left]
xref:nng_msg_alloc.3.adoc[nng_msg_alloc(3)],
xref:nng_msg_set_pipe.3.adoc[nng_msg_set_pipe(3)],
xref:nng_pipe_getopt.3.adoc[nng_pipe_getopt(3)],
xref:nng_pipe_get.3.adoc[nng_pipe_get(3)],
xref:nng.7.adoc[nng(7)]
2 changes: 1 addition & 1 deletion docs/man/nng_msg_set_pipe.3.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ None.
[.text-left]
xref:nng_msg_alloc.3.adoc[nng_msg_alloc(3)],
xref:nng_msg_get_pipe.3.adoc[nng_msg_get_pipe(3)],
xref:nng_pipe_getopt.3.adoc[nng_pipe_getopt(3)],
xref:nng_pipe_get.3.adoc[nng_pipe_get(3)],
xref:nng_msg.5.adoc[nng_msg(5)],
xref:nng.7.adoc[nng(7)]
2 changes: 1 addition & 1 deletion docs/man/nng_pipe.5.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ nng_pipe p = NNG_PIPE_INITIALIZER;
[.text-left]
xref:nng_msg_get_pipe.3.adoc[nng_msg_get_pipe(3)],
xref:nng_pipe_close.3.adoc[nng_pipe_close(3)],
xref:nng_pipe_getopt.3.adoc[nng_pipe_getopt(3)],
xref:nng_pipe_get.3.adoc[nng_pipe_get(3)],
xref:nng_pipe_dialer.3.adoc[nng_pipe_dialer(3)],
xref:nng_pipe_id.3.adoc[nng_pipe_id(3)],
xref:nng_pipe_listener.3.adoc[nng_pipe_listener(3)],
Expand Down
155 changes: 0 additions & 155 deletions docs/man/nng_pipe_getopt.3.adoc

This file was deleted.

19 changes: 0 additions & 19 deletions include/nng/nng.h
Original file line number Diff line number Diff line change
Expand Up @@ -1420,25 +1420,6 @@ NNG_DECL int nng_listener_setopt_ptr(
NNG_DECL int nng_listener_setopt_string(
nng_listener, const char *, const char *) NNG_DEPRECATED;

// Pipe options. Use nng_pipe_get instead.
NNG_DECL int nng_pipe_getopt(
nng_pipe, const char *, void *, size_t *) NNG_DEPRECATED;
NNG_DECL int nng_pipe_getopt_bool(
nng_pipe, const char *, bool *) NNG_DEPRECATED;
NNG_DECL int nng_pipe_getopt_int(nng_pipe, const char *, int *) NNG_DEPRECATED;
NNG_DECL int nng_pipe_getopt_ms(
nng_pipe, const char *, nng_duration *) NNG_DEPRECATED;
NNG_DECL int nng_pipe_getopt_size(
nng_pipe, const char *, size_t *) NNG_DEPRECATED;
NNG_DECL int nng_pipe_getopt_sockaddr(
nng_pipe, const char *, nng_sockaddr *) NNG_DEPRECATED;
NNG_DECL int nng_pipe_getopt_uint64(
nng_pipe, const char *, uint64_t *) NNG_DEPRECATED;
NNG_DECL int nng_pipe_getopt_ptr(
nng_pipe, const char *, void **) NNG_DEPRECATED;
NNG_DECL int nng_pipe_getopt_string(
nng_pipe, const char *, char **) NNG_DEPRECATED;

// nng_closeall closes all open sockets. Do not call this from
// a library; it will affect all sockets.
NNG_DECL void nng_closeall(void) NNG_DEPRECATED;
Expand Down
64 changes: 4 additions & 60 deletions src/nng_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ nng_getopt_ms(nng_socket id, const char *n, nng_duration *v)
return (nng_socket_get_ms(id, n, v));
}

int nng_getopt_ptr(nng_socket id, const char *n, void **v)
int
nng_getopt_ptr(nng_socket id, const char *n, void **v)
{
return (nng_socket_get_ptr(id, n, v));
}
Expand Down Expand Up @@ -241,8 +242,7 @@ nng_dialer_getopt_sockaddr(nng_dialer id, const char *n, nng_sockaddr *v)
}

int
nng_dialer_setopt(
nng_dialer id, const char *name, const void *v, size_t sz)
nng_dialer_setopt(nng_dialer id, const char *name, const void *v, size_t sz)
{
return (nng_dialer_set(id, name, v, sz));
}
Expand Down Expand Up @@ -394,66 +394,10 @@ nng_listener_setopt_string(nng_listener id, const char *n, const char *v)
return (nng_listener_set_string(id, n, v));
}

// Pipes

int
nng_pipe_getopt(nng_pipe id, const char *n, void *v, size_t *sz)
{
return (nng_pipe_get(id, n, v, sz));
}

int
nng_pipe_getopt_int(nng_pipe id, const char *n, int *v)
{
return (nng_pipe_get_int(id, n, v));
}

int
nng_pipe_getopt_bool(nng_pipe id, const char *n, bool *v)
{
return (nng_pipe_get_bool(id, n, v));
}

int
nng_pipe_getopt_size(nng_pipe id, const char *n, size_t *v)
{
return (nng_pipe_get_size(id, n, v));
}

int
nng_pipe_getopt_uint64(nng_pipe id, const char *n, uint64_t *v)
{
return (nng_pipe_get_uint64(id, n, v));
}

int
nng_pipe_getopt_string(nng_pipe id, const char *n, char **v)
{
return (nng_pipe_get_string(id, n, v));
}

int
nng_pipe_getopt_ptr(nng_pipe id, const char *n, void **v)
{
return (nng_pipe_get_ptr(id, n, v));
}

int
nng_pipe_getopt_ms(nng_pipe id, const char *n, nng_duration *v)
{
return (nng_pipe_get_ms(id, n, v));
}

int
nng_pipe_getopt_sockaddr(nng_pipe id, const char *n, nng_sockaddr *v)
{
return (nng_pipe_get_addr(id, n, v));
}

void
nng_closeall(void)
{
nni_sock_closeall();
}

#endif // NNG_ELIDE_DEPRECATED
#endif // NNG_ELIDE_DEPRECATED

0 comments on commit bdbc936

Please sign in to comment.