diff options
Diffstat (limited to 'Source/Kernel/SyscallManager')
-rw-r--r-- | Source/Kernel/SyscallManager/Res.ns.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/Kernel/SyscallManager/Res.ns.h b/Source/Kernel/SyscallManager/Res.ns.h index e454693..d3a0129 100644 --- a/Source/Kernel/SyscallManager/Res.ns.h +++ b/Source/Kernel/SyscallManager/Res.ns.h @@ -5,9 +5,19 @@ namespace Res { +extern Ressource** ressources; +extern u32int size; + u32int registerRes(Ressource* r); void unregisterRes(u32int id); +template <typename T> +T* get(u32int id, u32int type) { + if (id > size or ressources[id] == 0) return 0; + if (ressources[id]->resType() != type) return 0; + return (T*)ressources[id]; +} + u32int call(u32int ressource, u8int wat, u32int a, u32int b, u32int c, u32int d, u32int e); } |