Logo Search packages:      
Sourcecode: libnl version File versions  Download package

struct nl_cb* nl_cb_new ( enum nl_cb_kind  kind  )  [read]

Allocate a new callback handle

  • kind callback kind to be used for initialization
    Newly allocated callback handle or NULL

Definition at line 410 of file handlers.c.

References nl_cb_err(), and nl_cb_set().

Referenced by nl_cb_clone(), and nl_handle_alloc_nondefault().

      int i;
      struct nl_cb *cb;

      if (kind < 0 || kind > NL_CB_KIND_MAX)
            return NULL;

      cb = calloc(1, sizeof(*cb));
      if (!cb) {
            return NULL;

      for (i = 0; i <= NL_CB_TYPE_MAX; i++)
            nl_cb_set(cb, i, kind, NULL, NULL);

      nl_cb_err(cb, kind, NULL, NULL);

      return cb;

Generated by  Doxygen 1.6.0   Back to index