1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
#include <Xw_Extension.h>
/* ifdef then trace on */
#ifdef TRACE
#define TRACE_ISDEFINE_TYPE
#endif
/*
XW_STATUS Xw_isdefine_type (atypemap,index):
XW_EXT_TYPEMAP *atypemap
int index Line type index
Returns XW_ERROR if BadType Index or type is not defined
Returns XW_SUCCESS if Successful
*/
#ifdef XW_PROTOTYPE
XW_STATUS Xw_isdefine_type (void *atypemap,int index)
#else
XW_STATUS Xw_isdefine_type (atypemap,index)
void *atypemap;
int index ;
#endif /*XW_PROTOTYPE*/
{
XW_EXT_TYPEMAP *ptypemap = (XW_EXT_TYPEMAP*)atypemap;
XW_STATUS status = XW_ERROR ;
if ( index ) {
if ( ptypemap && (index < ptypemap->maxtype) &&
ptypemap->types[index] ) {
status = XW_SUCCESS ;
}
} else status = XW_SUCCESS ;
#ifdef TRACE_ISDEFINE_TYPE
if( Xw_get_trace() > 2 ) {
printf (" %d = Xw_isdefine_type(%lx,%d)\n",status,(long ) ptypemap,index) ;
}
#endif
return (status);
}
#ifdef XW_PROTOTYPE
XW_STATUS Xw_isdefine_typeindex (XW_EXT_TYPEMAP *atypemap,int index)
#else
XW_STATUS Xw_isdefine_typeindex (atypemap,index)
XW_EXT_TYPEMAP *atypemap;
int index ;
#endif /*XW_PROTOTYPE*/
/*
Verify type index range Only
*/
{
XW_EXT_TYPEMAP *ptypemap = (XW_EXT_TYPEMAP*)atypemap;
XW_STATUS status = XW_ERROR ;
if( ptypemap && (index > 0) && (index < ptypemap->maxtype) ) {
status = XW_SUCCESS ;
}
#ifdef TRACE_ISDEFINE_TYPE
if( Xw_get_trace() > 2 ) {
printf (" %d = Xw_isdefine_typeindex(%lx,%d)\n",status,(long ) ptypemap,index) ;
}
#endif
return (status) ;
}
|