Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gdamore/no ctx addr #1906

Merged
merged 2 commits into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions include/nng/nng.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,6 @@ NNG_DECL int nng_socket_set_uint64(nng_socket, const char *, uint64_t);
NNG_DECL int nng_socket_set_string(nng_socket, const char *, const char *);
NNG_DECL int nng_socket_set_ptr(nng_socket, const char *, void *);
NNG_DECL int nng_socket_set_ms(nng_socket, const char *, nng_duration);
NNG_DECL int nng_socket_set_addr(
nng_socket, const char *, const nng_sockaddr *);

NNG_DECL int nng_socket_get(nng_socket, const char *, void *, size_t *);
NNG_DECL int nng_socket_get_bool(nng_socket, const char *, bool *);
Expand All @@ -253,7 +251,6 @@ NNG_DECL int nng_socket_get_uint64(nng_socket, const char *, uint64_t *);
NNG_DECL int nng_socket_get_string(nng_socket, const char *, char **);
NNG_DECL int nng_socket_get_ptr(nng_socket, const char *, void **);
NNG_DECL int nng_socket_get_ms(nng_socket, const char *, nng_duration *);
NNG_DECL int nng_socket_get_addr(nng_socket, const char *, nng_sockaddr *);

// These functions are used to obtain a file descriptor that will poll
// as readable if the socket can receive or send. Applications must never
Expand Down Expand Up @@ -485,7 +482,6 @@ NNG_DECL int nng_ctx_get_uint64(nng_ctx, const char *, uint64_t *);
NNG_DECL int nng_ctx_get_string(nng_ctx, const char *, char **);
NNG_DECL int nng_ctx_get_ptr(nng_ctx, const char *, void **);
NNG_DECL int nng_ctx_get_ms(nng_ctx, const char *, nng_duration *);
NNG_DECL int nng_ctx_get_addr(nng_ctx, const char *, nng_sockaddr *);

NNG_DECL int nng_ctx_set(nng_ctx, const char *, const void *, size_t);
NNG_DECL int nng_ctx_set_bool(nng_ctx, const char *, bool);
Expand All @@ -495,7 +491,6 @@ NNG_DECL int nng_ctx_set_uint64(nng_ctx, const char *, uint64_t);
NNG_DECL int nng_ctx_set_string(nng_ctx, const char *, const char *);
NNG_DECL int nng_ctx_set_ptr(nng_ctx, const char *, void *);
NNG_DECL int nng_ctx_set_ms(nng_ctx, const char *, nng_duration);
NNG_DECL int nng_ctx_set_addr(nng_ctx, const char *, const nng_sockaddr *);

// nng_alloc is used to allocate memory. It's intended purpose is for
// allocating memory suitable for message buffers with nng_send().
Expand Down
12 changes: 0 additions & 12 deletions src/compat/CMakeLists.txt

This file was deleted.

24 changes: 0 additions & 24 deletions src/nng.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,12 +469,6 @@ nng_ctx_get_ms(nng_ctx id, const char *n, nng_duration *v)
return (ctx_get(id, n, v, NULL, NNI_TYPE_DURATION));
}

int
nng_ctx_get_addr(nng_ctx id, const char *n, nng_sockaddr *v)
{
return (ctx_get(id, n, v, NULL, NNI_TYPE_SOCKADDR));
}

static int
ctx_set(nng_ctx id, const char *n, const void *v, size_t sz, nni_type t)
{
Expand Down Expand Up @@ -541,12 +535,6 @@ nng_ctx_set_string(nng_ctx id, const char *n, const char *v)
ctx_set(id, n, v, v == NULL ? 0 : strlen(v) + 1, NNI_TYPE_STRING));
}

int
nng_ctx_set_addr(nng_ctx id, const char *n, const nng_sockaddr *v)
{
return (ctx_set(id, n, v, sizeof(*v), NNI_TYPE_SOCKADDR));
}

int
nng_dial(nng_socket sid, const char *addr, nng_dialer *dp, int flags)
{
Expand Down Expand Up @@ -1065,12 +1053,6 @@ nng_socket_set_string(nng_socket id, const char *n, const char *v)
id, n, v, v == NULL ? 0 : strlen(v) + 1, NNI_TYPE_STRING));
}

int
nng_socket_set_addr(nng_socket id, const char *n, const nng_sockaddr *v)
{
return (socket_set(id, n, v, sizeof(*v), NNI_TYPE_SOCKADDR));
}

static int
socket_get(nng_socket s, const char *name, void *val, size_t *szp, nni_type t)
{
Expand Down Expand Up @@ -1136,12 +1118,6 @@ nng_socket_get_ms(nng_socket id, const char *n, nng_duration *v)
return (socket_get(id, n, v, NULL, NNI_TYPE_DURATION));
}

int
nng_socket_get_addr(nng_socket id, const char *n, nng_sockaddr *v)
{
return (socket_get(id, n, v, NULL, NNI_TYPE_SOCKADDR));
}

int
nng_socket_get_recv_poll_fd(nng_socket id, int *fdp)
{
Expand Down
Loading