2 #include <Xw_Extension.h>
4 /* ifdef then trace on */
6 #define TRACE_GET_TYPEMAP_INFO
10 XW_STATUS Xw_get_typemap_info (atypemap,mtype,utype,dtype,ftype):
11 XW_EXT_TYPEMAP *atypemap
12 int *mtype Return the maximum type number of the typemap
13 int *utype Return the User type number used in the typemap
14 int *dtype Return the User type number defined in the typemap
15 int *ftype Return the First Free type index in the typemap
16 NOTE than if ftype < 0 , No more Free type exist in the typemap
18 Returns XW_ERROR if the Extended Typemap is not defined
19 Returns XW_SUCCESS if successful
24 XW_STATUS Xw_get_typemap_info (void *atypemap,int *mtype,int *utype,int *dtype,int *ftype)
26 XW_STATUS Xw_get_typemap_info (atypemap,mtype,utype,dtype,ftype)
28 int *mtype,*utype,*dtype,*ftype ;
29 #endif /*XW_PROTOTYPE*/
31 XW_EXT_TYPEMAP *ptypemap = (XW_EXT_TYPEMAP*)atypemap;
34 if( !Xw_isdefine_typemap(ptypemap) ) {
35 /*ERROR*Bad EXT_TYPEMAP Address*/
36 Xw_set_error(51,"Xw_get_typemap_info",ptypemap) ;
41 *utype = ptypemap->maxtype ;
44 for( i=0 ; i< *utype ; i++ ) {
45 if( ptypemap->types[i] ) (*dtype)++ ;
46 else if( i && *ftype < 0 ) *ftype = i ;
49 #ifdef TRACE_GET_TYPEMAP_INFO
50 if( Xw_get_trace() ) {
51 printf (" Xw_get_typemap_info(%lx,%d,%d,%d,%d)\n",
52 (long ) ptypemap,*mtype,*utype,*dtype,*ftype) ;