parent.h (576B)
1/* SPDX-License-Identifier: MIT */ 2#ifndef __NVIF_PARENT_H__ 3#define __NVIF_PARENT_H__ 4#include <nvif/os.h> 5struct nvif_object; 6 7struct nvif_parent { 8 const struct nvif_parent_func { 9 void (*debugf)(struct nvif_object *, const char *fmt, ...) __printf(2, 3); 10 void (*errorf)(struct nvif_object *, const char *fmt, ...) __printf(2, 3); 11 } *func; 12}; 13 14static inline void 15nvif_parent_dtor(struct nvif_parent *parent) 16{ 17 parent->func = NULL; 18} 19 20static inline void 21nvif_parent_ctor(const struct nvif_parent_func *func, struct nvif_parent *parent) 22{ 23 parent->func = func; 24} 25#endif