• Home
  • Raw
  • Download

Lines Matching refs:ops

54 struct nl_object *nl_object_alloc(struct nl_object_ops *ops)  in nl_object_alloc()  argument
58 if (ops->oo_size < sizeof(*new)) in nl_object_alloc()
61 new = calloc(1, ops->oo_size); in nl_object_alloc()
68 new->ce_ops = ops; in nl_object_alloc()
69 if (ops->oo_constructor) in nl_object_alloc()
70 ops->oo_constructor(new); in nl_object_alloc()
86 struct nl_cache_ops *ops; in nl_object_alloc_name() local
88 ops = nl_cache_ops_lookup_safe(kind); in nl_object_alloc_name()
89 if (!ops) in nl_object_alloc_name()
92 *result = nl_object_alloc(ops->co_obj_ops); in nl_object_alloc_name()
93 nl_cache_ops_put(ops); in nl_object_alloc_name()
113 struct nl_object_ops *ops; in nl_object_clone() local
120 ops = obj_ops(obj); in nl_object_clone()
121 new = nl_object_alloc(ops); in nl_object_clone()
125 size = ops->oo_size - doff; in nl_object_clone()
136 if (ops->oo_clone) { in nl_object_clone()
137 if (ops->oo_clone(new, obj) < 0) { in nl_object_clone()
141 } else if (size && ops->oo_free_data) in nl_object_clone()
156 struct nl_object_ops *ops = obj_ops(dst); in nl_object_update() local
158 if (ops->oo_update) in nl_object_update()
159 return ops->oo_update(dst, src); in nl_object_update()
172 struct nl_object_ops *ops; in nl_object_free() local
177 ops = obj_ops(obj); in nl_object_free()
185 if (ops->oo_free_data) in nl_object_free()
186 ops->oo_free_data(obj); in nl_object_free()
315 struct nl_object_ops *ops = obj_ops(a); in nl_object_identical() local
319 if (ops != obj_ops(b)) in nl_object_identical()
322 if (ops->oo_id_attrs_get) { in nl_object_identical()
323 int req_attrs_a = ops->oo_id_attrs_get(a); in nl_object_identical()
324 int req_attrs_b = ops->oo_id_attrs_get(b); in nl_object_identical()
328 } else if (ops->oo_id_attrs) { in nl_object_identical()
329 req_attrs = ops->oo_id_attrs; in nl_object_identical()
343 if (ops->oo_compare == NULL) in nl_object_identical()
346 return !(ops->oo_compare(a, b, req_attrs, 0)); in nl_object_identical()
363 struct nl_object_ops *ops = obj_ops(a); in nl_object_diff() local
365 if (ops != obj_ops(b) || ops->oo_compare == NULL) in nl_object_diff()
368 return ops->oo_compare(a, b, ~0, 0); in nl_object_diff()
382 struct nl_object_ops *ops = obj_ops(obj); in nl_object_match_filter() local
384 if (ops != obj_ops(filter) || ops->oo_compare == NULL) in nl_object_match_filter()
387 return !(ops->oo_compare(obj, filter, filter->ce_mask, in nl_object_match_filter()
406 struct nl_object_ops *ops = obj_ops(obj); in nl_object_attrs2str() local
408 if (ops->oo_attrs2str != NULL) in nl_object_attrs2str()
409 return ops->oo_attrs2str(attrs, buf, len); in nl_object_attrs2str()
440 struct nl_object_ops *ops = obj_ops(obj); in nl_object_keygen() local
442 if (ops->oo_keygen) in nl_object_keygen()
443 ops->oo_keygen(obj, hashkey, hashtbl_sz); in nl_object_keygen()
528 struct nl_object_ops *ops = obj_ops(obj); in nl_object_get_id_attrs() local
531 if (!ops) in nl_object_get_id_attrs()
534 if (ops->oo_id_attrs_get) in nl_object_get_id_attrs()
535 id_attrs = ops->oo_id_attrs_get(obj); in nl_object_get_id_attrs()
537 id_attrs = ops->oo_id_attrs; in nl_object_get_id_attrs()