Fixed binary search: no more infinite loops when vendor is unknown.
[tangerine.git] / workbench / libs / muimaster / mui_newobject.c
blobbbc5b780b568762ba15ef2182f9ecd1c425ad6be
1 /*
2 Copyright © 2002-2007, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <proto/exec.h>
7 #include <proto/intuition.h>
8 #include <proto/muimaster.h>
10 #include "mui.h"
11 #include "muimaster_intern.h"
13 /* #define MYDEBUG 1 */
14 #include "debug.h"
16 /*****************************************************************************
18 NAME */
19 AROS_LH2(Object *, MUI_NewObjectA,
21 /* SYNOPSIS */
22 AROS_LHA(ClassID, classid, A0),
23 AROS_LHA(struct TagItem *, tags, A1),
25 /* LOCATION */
26 struct Library *, MUIMasterBase, 5, MUIMaster)
28 /* FUNCTION
29 Create object from MUI class.
31 INPUTS
32 classid - case sensitive name/ID string of a MUI class.
33 taglist - attribute/value pairs for the new object.
35 RESULT
36 Pointer to object. NULL means failure.
38 NOTES
40 EXAMPLE
42 BUGS
44 SEE ALSO
45 MUI_DisposeObject(), intuition.library/SetAttrsA()
46 intuition.library/GetAttr()
48 INTERNALS
50 HISTORY
52 *****************************************************************************/
54 AROS_LIBFUNC_INIT
56 Class *cl;
58 cl = MUI_GetClass(classid);
59 if (cl)
61 Object *obj = NewObjectA(cl, NULL, tags);
63 if (obj) return obj;
65 bug("*** Could not create object of %s\n", classid);
66 MUI_FreeClass(cl);
69 bug("*** Couldn't find %s\n", classid);
71 return NULL;
73 AROS_LIBFUNC_EXIT
74 } /* MUIA_NewObjectA */