nmctx
struct nmctx *ctx;
struct nmctx;
struct nmctx *ctx);
struct nmctx *ctx);
void *token, struct nmctx *ctx);
struct nmctx *ctx; /* the nmctx for errors and malloc/free */
int32_t nmreq_get_mem_id(const char **portname, struct nmctx *ctx);
typedef void (*nmctx_error_cb)(struct nmctx *, const char *);
typedef void *(*nmctx_malloc_cb)(struct nmctx *,size_t);
typedef void (*nmctx_free_cb)(struct nmctx *,void *);
typedef void (*nmctx_lock_cb)(struct nmctx *, int);
struct nmctx *nmctx_get(void);
struct nmctx *nmctx_set_default(struct nmctx *ctx);
void nmctx_ferror(struct nmctx *, const char *, ...);
void *nmctx_malloc(struct nmctx *, size_t);
void nmctx_free(struct nmctx *, void *);
void nmctx_lock(struct nmctx *);
void nmctx_unlock(struct nmctx *);
struct nmctx up;
nmctx_pthread_lock(struct nmctx *ctx, int lock)
struct nmctx *old;
nmctx_malloc(struct nmctx *ctx, size_t sz)
nmctx_free(struct nmctx *ctx, void *p)
nmctx_lock(struct nmctx *ctx)
nmctx_unlock(struct nmctx *ctx)
nmctx_default_error(struct nmctx *ctx, const char *errmsg)
nmctx_default_malloc(struct nmctx *ctx, size_t sz)
nmctx_default_free(struct nmctx *ctx, void *p)
static struct nmctx nmctx_global = {
static struct nmctx *nmctx_default = &nmctx_global;
struct nmctx *
struct nmctx *
nmctx_set_default(struct nmctx *ctx)
struct nmctx *old = nmctx_default;
nmctx_ferror(struct nmctx *ctx, const char *fmt, ...)
struct nmctx *ctx = nmctx_get();
struct nmctx *ctx = d->ctx;
struct nmctx *ctx = d->ctx;
struct nmctx *ctx = d->ctx;
struct nmctx *ctx = p->ctx;
struct nmctx *ctx = d->ctx;
struct nmctx *ctx = d->ctx;
struct nmctx *ctx = d->ctx;
nmport_new_with_ctx(struct nmctx *ctx)
struct nmctx *ctx;
nmreq_header_decode(const char **pifname, struct nmreq_header *h, struct nmctx *ctx)
nmreq_get_mem_id(const char **pifname, struct nmctx *ctx)
nmreq_register_decode(const char **pifname, struct nmreq_register *r, struct nmctx *ctx)
void *token, struct nmctx *ctx)
void *token, struct nmctx *ctx)
struct nmctx *nmctx;
if (nmreq_header_decode(&ctx->ifparse, hdr, ctx->nmctx) < 0) {
if (nmreq_register_decode(&ctx->ifparse, reg, ctx->nmctx) < 0) {
nmctx_parsing_error(struct nmctx *ctx, const char *msg)
struct nmctx test_nmctx, *nmctx;
nmctx = nmctx_get();
if (nmctx == NULL) {
test_nmctx = *nmctx;
ctx->nmctx = &test_nmctx;
ctx->nmctx = NULL;