src/java.desktop/unix/native/libawt_xawt/xawt/gnome_interface.c
author ihse
Sat, 03 Mar 2018 08:21:47 +0100
branchihse-warnings-cflags-branch
changeset 56230 489867818774
parent 47216 71c04702a3d5
permissions -rw-r--r--
No longer disable E_OLD_STYLE_FUNC_DEF.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16471
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
     1
/*
29734
1a77512b0417 8075717: Replace INTERNAL_BUILD with DEBUG in awt
ihse
parents: 26751
diff changeset
     2
 * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
16471
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
     4
 *
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    10
 *
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    15
 * accompanied this code).
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    16
 *
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    20
 *
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    23
 * questions.
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    24
 */
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    25
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    26
#include "gnome_interface.h"
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    27
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    28
GNOME_URL_SHOW_TYPE *gnome_url_show = NULL;
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    29
56230
489867818774 No longer disable E_OLD_STYLE_FUNC_DEF.
ihse
parents: 47216
diff changeset
    30
gboolean gnome_load(void) {
16471
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    31
     void *vfs_handle;
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    32
     void *gnome_handle;
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    33
     const char *errmsg;
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    34
     GNOME_VFS_INIT_TYPE *gnome_vfs_init;
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    35
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    36
     // trying to open the gnomevfs. VERSIONED_JNI_LIB_NAME
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    37
     // macros formats the library name in a system specific manner
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    38
     // see jdk/src/solaris/javavm/export/jvm_md.h for more details
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    39
     vfs_handle = dlopen(VERSIONED_JNI_LIB_NAME("gnomevfs-2", "0"), RTLD_LAZY);
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    40
     if (vfs_handle == NULL) {
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    41
         // if we cannot load the library using a version assumed by JNI
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    42
         // we are trying to load the library without a version suffix
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    43
         vfs_handle = dlopen(JNI_LIB_NAME("gnomevfs-2"), RTLD_LAZY);
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    44
         if (vfs_handle == NULL) {
29734
1a77512b0417 8075717: Replace INTERNAL_BUILD with DEBUG in awt
ihse
parents: 26751
diff changeset
    45
 #ifdef DEBUG
16471
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    46
             fprintf(stderr, "can not load libgnomevfs-2.so\n");
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    47
 #endif
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    48
             return FALSE;
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    49
         }
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    50
     }
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    51
     dlerror(); /* Clear errors */
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    52
     gnome_vfs_init = (GNOME_VFS_INIT_TYPE*)dlsym(vfs_handle, "gnome_vfs_init");
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    53
     if (gnome_vfs_init == NULL){
29734
1a77512b0417 8075717: Replace INTERNAL_BUILD with DEBUG in awt
ihse
parents: 26751
diff changeset
    54
 #ifdef DEBUG
16471
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    55
         fprintf(stderr, "dlsym( gnome_vfs_init) returned NULL\n");
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    56
 #endif
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    57
         return FALSE;
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    58
     }
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    59
     if ((errmsg = dlerror()) != NULL) {
29734
1a77512b0417 8075717: Replace INTERNAL_BUILD with DEBUG in awt
ihse
parents: 26751
diff changeset
    60
 #ifdef DEBUG
16471
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    61
         fprintf(stderr, "can not find symbol gnome_vfs_init %s \n", errmsg);
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    62
 #endif
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    63
         return FALSE;
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    64
     }
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    65
     // call gonme_vfs_init()
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    66
     (*gnome_vfs_init)();
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    67
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    68
     gnome_handle = dlopen(VERSIONED_JNI_LIB_NAME("gnome-2", "0"), RTLD_LAZY);
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    69
     if (gnome_handle == NULL) {
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    70
         gnome_handle = dlopen(JNI_LIB_NAME("gnome-2"), RTLD_LAZY);
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    71
         if (gnome_handle == NULL) {
29734
1a77512b0417 8075717: Replace INTERNAL_BUILD with DEBUG in awt
ihse
parents: 26751
diff changeset
    72
 #ifdef DEBUG
16471
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    73
             fprintf(stderr, "can not load libgnome-2.so\n");
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    74
 #endif
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    75
             return FALSE;
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    76
         }
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    77
     }
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    78
     dlerror(); /* Clear errors */
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    79
     gnome_url_show = (GNOME_URL_SHOW_TYPE*)dlsym(gnome_handle, "gnome_url_show");
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    80
     if ((errmsg = dlerror()) != NULL) {
29734
1a77512b0417 8075717: Replace INTERNAL_BUILD with DEBUG in awt
ihse
parents: 26751
diff changeset
    81
 #ifdef DEBUG
16471
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    82
         fprintf(stderr, "can not find symble gnome_url_show\n");
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    83
 #endif
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    84
         return FALSE;
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    85
     }
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    86
     return TRUE;
33bca48c948b 7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
denis
parents:
diff changeset
    87
}