< prev index next >

src/java.desktop/unix/native/libawt/awt/awt_Mlib.c

Print this page




  43  * This is called by awt_ImagingLib.initLib() to figure out if we
  44  * can use the VIS version of medialib
  45  */
  46 mlib_status awt_getImagingLib(JNIEnv *env, mlibFnS_t *sMlibFns,
  47                               mlibSysFnS_t *sMlibSysFns) {
  48     int status;
  49     jstring jstr = NULL;
  50     mlibFnS_t *mptr;
  51     void *(*vPtr)();
  52     int (*intPtr)();
  53     mlib_status (*fPtr)();
  54     int i;
  55     void *handle = NULL;
  56     mlibSysFnS_t tempSysFns;
  57     static int s_timeIt = 0;
  58     static int s_verbose = 1;
  59     mlib_status ret = MLIB_SUCCESS;
  60     struct utsname name;
  61 
  62     /*
  63      * Find out the machine name. If it is an SUN ultra, we
  64      * can use the vis library
  65      */
  66     if ((uname(&name) >= 0) && (getenv("NO_VIS") == NULL) &&
  67         (strncmp(name.machine, "sun4u" , 5) == 0) ||
  68         ((strncmp(name.machine, "sun4v" , 5) == 0) &&
  69          (getenv("USE_VIS_ON_SUN4V") != NULL)))
  70     {
  71         handle = dlopen(JNI_LIB_NAME("mlib_image_v"), RTLD_LAZY);
  72     }
  73 
  74     if (handle == NULL) {
  75         handle = dlopen(JNI_LIB_NAME("mlib_image"), RTLD_LAZY);
  76     }
  77 
  78     if (handle == NULL) {
  79         if (s_timeIt || s_verbose) {
  80             printf ("error in dlopen: %s", dlerror());
  81         }
  82         return MLIB_FAILURE;
  83     }
  84 
  85     /* So, if we are here, then either vis or generic version of
  86      * medialib library was sucessfuly loaded.
  87      * Let's try to initialize handlers...
  88      */
  89     if ((tempSysFns.createFP = (MlibCreateFP_t)dlsym(handle,




  43  * This is called by awt_ImagingLib.initLib() to figure out if we
  44  * can use the VIS version of medialib
  45  */
  46 mlib_status awt_getImagingLib(JNIEnv *env, mlibFnS_t *sMlibFns,
  47                               mlibSysFnS_t *sMlibSysFns) {
  48     int status;
  49     jstring jstr = NULL;
  50     mlibFnS_t *mptr;
  51     void *(*vPtr)();
  52     int (*intPtr)();
  53     mlib_status (*fPtr)();
  54     int i;
  55     void *handle = NULL;
  56     mlibSysFnS_t tempSysFns;
  57     static int s_timeIt = 0;
  58     static int s_verbose = 1;
  59     mlib_status ret = MLIB_SUCCESS;
  60     struct utsname name;
  61 
  62     /*
  63      * Find out the machine name. If it is a SUN ultra, we
  64      * can use the vis library
  65      */
  66     if ((uname(&name) >= 0) && (((getenv("NO_VIS") == NULL) &&
  67         (strncmp(name.machine, "sun4u" , 5) == 0)) ||
  68         ((strncmp(name.machine, "sun4v" , 5) == 0) &&
  69          (getenv("USE_VIS_ON_SUN4V") != NULL))))
  70     {
  71         handle = dlopen(JNI_LIB_NAME("mlib_image_v"), RTLD_LAZY);
  72     }
  73 
  74     if (handle == NULL) {
  75         handle = dlopen(JNI_LIB_NAME("mlib_image"), RTLD_LAZY);
  76     }
  77 
  78     if (handle == NULL) {
  79         if (s_timeIt || s_verbose) {
  80             printf ("error in dlopen: %s", dlerror());
  81         }
  82         return MLIB_FAILURE;
  83     }
  84 
  85     /* So, if we are here, then either vis or generic version of
  86      * medialib library was sucessfuly loaded.
  87      * Let's try to initialize handlers...
  88      */
  89     if ((tempSysFns.createFP = (MlibCreateFP_t)dlsym(handle,


< prev index next >