2 * ion/ioncore/reginfo.c
4 * Copyright (c) Tuomo Valkonen 1999-2007.
6 * Ion is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version.
17 #include <libtu/objp.h>
22 static WRegClassInfo *reg_class_infos;
28 bool ioncore_register_regclass(ClassDescr *descr, WRegionLoadCreateFn *lc_fn)
35 info=ALLOC(WRegClassInfo);
41 LINK_ITEM(reg_class_infos, info, next, prev);
47 void ioncore_unregister_regclass(ClassDescr *descr)
51 for(info=reg_class_infos; info!=NULL; info=info->next){
52 if(descr==info->descr){
53 UNLINK_ITEM(reg_class_infos, info, next, prev);
67 WRegClassInfo *ioncore_lookup_regclass(const char *name, bool inheriting_ok)
75 for(info=reg_class_infos; info!=NULL; info=info->next){
76 for(descr=info->descr;
78 descr=(inheriting_ok ? descr->ancestor : NULL)){
80 if(strcmp(descr->name, name)==0){