Lines Matching defs:cb
26 struct nl_cb *cb;
28 cb = (struct nl_cb *) malloc(sizeof(struct nl_cb));
29 if (cb == NULL)
31 memset(cb, 0, sizeof(*cb));
33 return nl_cb_get(cb);
57 int nl_cb_set(struct nl_cb *cb, enum nl_cb_type type, enum nl_cb_kind kind, \
60 cb->cb_set[type] = func;
61 cb->cb_args[type] = arg;
68 int nl_cb_err(struct nl_cb *cb, enum nl_cb_kind kind, \
71 cb->cb_err = func;
72 cb->cb_err_arg = arg;
77 struct nl_cb *nl_cb_get(struct nl_cb *cb)
79 cb->cb_refcnt++;
80 return cb;
83 void nl_cb_put(struct nl_cb *cb)
85 if (!cb)
87 cb->cb_refcnt--;
88 if (cb->cb_refcnt <= 0)
89 free(cb);