/*
 * Java-Gnome Bindings Library
 *
 * Copyright 1998-2002 the Java-Gnome Team, all rights reserved.
 *
 * The Java-Gnome Team Members:
 *   Jean Van Wyk <jeanvanwyk@iname.com>
 *   Jeffrey S. Morgan <jeffrey.morgan@bristolwest.com>
 *   Dan Bornstein <danfuzz@milk.com>
 *
 * The Java-Gnome bindings library is free software distributed under
 * the terms of the GNU Library General Public License version 2.
 *
 * This file was orriginally generated by the Java-GNOME Code Generator
 * Please do not modify the code that is identified as generated.  Also,
 * please insert your code above the generated code.
 *
 * Generation date: 2002-07-26 07:01:03 EDT
 */

#include <jni.h>
#include <sys/types.h>
#include <glib.h>
#include <glib-object.h>
#ifdef __cplusplus
extern "C" 
{
#endif
    /****************************************
     * BEGINNING OF GENERATED CODE
     ****************************************/
    GQuark  GError_get_domain (GError * cptr) 
    {
        return cptr->domain;
    }

    /*
     * Class:     org.gnu.glib.Error
     * Method:    getDomain
     * Signature: (I)I
     */
    JNIEXPORT jint JNICALL Java_org_gnu_glib_Error_getDomain (JNIEnv *env, jclass cls, jint obj) 
    {
        GError *obj_g = (GError *)obj;
        return (jint)GError_get_domain (obj_g);
    }


    gint32 GError_get_code (GError * cptr) 
    {
        return cptr->code;
    }

    /*
     * Class:     org.gnu.glib.Error
     * Method:    getCode
     * Signature: (I)I
     */
    JNIEXPORT jint JNICALL Java_org_gnu_glib_Error_getCode (JNIEnv *env, jclass cls, jint obj) 
    {
        GError *obj_g = (GError *)obj;
        jint result_j = (jint) (GError_get_code (obj_g));
        return result_j;
    }

    gchar * GError_get_message (GError * cptr) 
    {
        return cptr->message;
    }

    /*
     * Class:     org.gnu.glib.Error
     * Method:    getMessage
     * Signature: (I)java/Lang/String;
     */
    JNIEXPORT jstring JNICALL Java_org_gnu_glib_Error_getMessage (JNIEnv *env, jclass cls, jint obj) 
    {
        GError *obj_g = (GError *)obj;
        const gchar *result_g = GError_get_message (obj_g);
        jstring str = (*env)->NewStringUTF(env, result_g);
        return str;
    }

    /*
     * Class:     org.gnu.glib.Error
     * Method:    g_error_new_literal
     * Signature: (IIjava.lang.String;)I
     */
    JNIEXPORT jint JNICALL Java_org_gnu_glib_Error_g_1error_1new_1literal (JNIEnv *env, jclass cls, 
        jint domain, jint code, jstring message) 
    {
        GQuark *domain_g = (GQuark *)domain;
        gint32 code_g = (gint32) code;
        const gchar* message_g = (*env)->GetStringUTFChars(env, message, 0);
        jint retval = (jint)g_error_new_literal (domain_g, code_g, message_g);
        (*env)->ReleaseStringUTFChars(env, message, message_g);
        return retval;
    }

    /*
     * Class:     org.gnu.glib.Error
     * Method:    g_error_free
     * Signature: (I)V
     */
    JNIEXPORT void JNICALL Java_org_gnu_glib_Error_g_1error_1free (JNIEnv *env, jclass cls, jint 
        error) 
    {
        GError *error_g = (GError *)error;
        g_error_free (error_g);
    }

    /****************************************
     * END OF GENERATED CODE
     ****************************************/
#ifdef __cplusplus
}

#endif
