Lines Matching defs:new
38 * Allocate a new object of kind specified by the operations handle
40 * @return The new object or NULL
44 struct nl_object *new;
46 if (ops->oo_size < sizeof(*new))
49 new = calloc(1, ops->oo_size);
50 if (!new)
53 new->ce_refcnt = 1;
54 nl_init_list_head(&new->ce_list);
56 new->ce_ops = ops;
58 ops->oo_constructor(new);
60 NL_DBG(4, "Allocated new object %p\n", new);
62 return new;
66 * Allocate a new object of kind specified by the name
68 * @return The new object or nULL
90 * Allocate a new object and copy all data from an existing object
92 * @return The new object or NULL.
96 struct nl_object *new;
101 new = nl_object_alloc(ops);
102 if (!new)
109 new->ce_ops = obj->ce_ops;
110 new->ce_msgtype = obj->ce_msgtype;
111 new->ce_mask = obj->ce_mask;
114 memcpy((void *)new + doff, (void *)obj + doff, size);
117 if (ops->oo_clone(new, obj) < 0) {
118 nl_object_free(new);
124 return new;
165 NL_DBG(4, "New reference to object %p, total %d\n",