/**********************************************************************
 
	Copyright (C) 2003 Hirohisa MORI <joshua@nichibun.ac.jp>
 
	This program is free software; you can redistribute it 
	and/or modify it under the terms of the GLOBALBASE 
	Library General Public License (G-LGPL) as published by 

	http://www.globalbase.org/
 
	This program is distributed in the hope that it will be 
	useful, but WITHOUT ANY WARRANTY; without even the 
	implied warranty of MERCHANTABILITY or FITNESS FOR A 
	PARTICULAR PURPOSE.

**********************************************************************/



#include	"xl.h"
#include	"gbview.h"
#include	"avt.h"
#include	"memory_debug.h"

int cmp_obj_code();


OBJ *
search_obj(RESOURCE * r,unsigned int id)
{
OBJ * o;
AVT_NODE * a1;
OBJ o1;
	if ( r->h.type != RT_DRAW_GB )
		return 0;
	o1.h.code = id;
	a1 = avt_search(r->draw_gb.obj_code_tree,&o1,cmp_obj_code);
	if ( a1 == 0 ) {
		o = 0;
		goto ret;
	}
	o = a1->data;
ret:
	return o;
}
