ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/otypes.c
Revision: 2.4
Committed: Mon Mar 10 17:13:29 2003 UTC (21 years, 1 month ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: rad3R7P2, rad3R7P1, rad4R0, rad3R5, rad3R6, rad3R6P1, rad3R8, rad3R9
Changes since 2.3: +3 -2 lines
Log Message:
Compile error fixes for Linux and other improvements

File Contents

# Content
1 #ifndef lint
2 static const char RCSid[] = "$Id$";
3 #endif
4 /*
5 * Object type lookup and error reporting
6 *
7 * External symbols declared in object.h
8 */
9
10 #include "copyright.h"
11
12 #include "standard.h"
13
14 #include "object.h"
15
16 #include "otypes.h"
17
18
19 int
20 otype(ofname) /* get object function number from its name */
21 register char *ofname;
22 {
23 register int i;
24
25 for (i = 0; i < NUMOTYPE; i++)
26 if (!strcmp(ofun[i].funame, ofname))
27 return(i);
28
29 return(-1); /* not found */
30 }
31
32
33 void
34 objerror(o, etyp, msg) /* report error related to object */
35 OBJREC *o;
36 int etyp;
37 char *msg;
38 {
39 char msgbuf[128];
40
41 sprintf(msgbuf, "%s for %s \"%s\"",
42 msg, ofun[o->otype].funame,
43 o->oname!=NULL ? o->oname : "(NULL)");
44 error(etyp, msgbuf);
45 }