⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jam.h

📁 java 1.1 gemini 08_16
💻 H
字号:
/*****************************************************************************
*  Copyright Statement:
*  --------------------
*  This software is protected by Copyright and the information contained
*  herein is confidential. The software may not be copied and the information
*  contained herein may not be used or disclosed except with the written
*  permission of MediaTek Inc. (C) 2005
*
*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
*
*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/

/*******************************************************************************
 * Filename:
 * ---------
 *  jam.h
 *
 * Project:
 * --------
 *  MAUI
 *
 * Description:
 * ------------
 *  
 *
 * Author:
 * -------
 *  
 *
 *==============================================================================
 *             HISTORY
 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
 *------------------------------------------------------------------------------
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 *------------------------------------------------------------------------------
 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
 *==============================================================================
 *******************************************************************************/

/*
 * Copyright (c) 1999-2001 Sun Microsystems, Inc. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of Sun
 * Microsystems, Inc. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Sun.
 * 
 * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
 * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
 * THIS SOFTWARE OR ITS DERIVATIVES.
 * 
 * Use is subject to license terms.
 */

/*=========================================================================
 * SYSTEM:    JAM
 * SUBSYSTEM: Java Application Manager.
 * FILE:      jam.h
 * OVERVIEW:  Declaration of internal functions used strictly within
 *            the JAM prototype implementation. None of these functions
 *            are public and should not be used by outside modules.
 *
 * AUTHOR:    Ioi Lam, Consumer & Embedded, Sun Microsystems, Inc.
 *            KVM integration by Todd Kennedy and Sheng Liang
 *=======================================================================*/

#ifndef _JAM_H_
#define _JAM_H_

/*=========================================================================
 * Include files
 *=======================================================================*/
#include <midpMalloc.h>

#ifdef __cplusplus__
extern "C"
{
#endif /* __cplusplus__ */ 

/*=========================================================================
 * Definitions and declarations
 *=======================================================================*/

#define APPLICATION_NAME_TAG    "Application-Name"
#define APPLICATION_VERSION_TAG "Application-Version"
#define KVM_VERSION_TAG         "KVM-Version"
#define JAR_FILE_URL_TAG        "JAR-File-URL"
#define JAR_FILE_SIZE_TAG       "JAR-File-Size"
#define MAIN_CLASS_TAG          "Main-Class"
#define USE_ONCE_TAG            "Use-Once"

    /* Standard JAM descriptor file tag names. */
#define ST_INFO              101
#define ST_DOWNLOAD          102

#define HIDE_APP_SIZE        0
#define SHOW_APP_SIZE        1

#define EXI_OLDER_THAN_REQ    -1
#define EXI_SAME_AS_REQ       0
#define EXI_NEWER_THAN_REQ    1

#define JAM_BAD_URL           1
#define JAM_INVALID_MANIFEST  2
#define JAM_MISC_ERROR        3

#define CONTENT_HTML          1
#define CONTENT_JAVA_MANIFEST 2

#define JAM_RETURN_OK         0
#define JAM_RETURN_ERR        -1023

    /* Misc utility macros */
#define IS_SPACE(c) ((c) == ' ' || (c) == '\r' || (c) == '\n' || (c) == '\t')

#ifndef SLEEP_MILLIS
#ifdef WIN32
#define SLEEP_MILLIS(x) (Sleep((x)))
#else 
#define SLEEP_MILLIS(x) (usleep((x)*1000))
#endif 
#endif /* SLEEP_MILLIS */ 

#ifndef __FUNC_DECL
#if defined(__STDC__) || defined (__MTK_TARGET__)
#define __FUNC_DECL(p)  p
#else 
#define __FUNC_DECL(p)  ()
#endif 
#endif /* __FUNC_DECL */ 

/*=========================================================================
 * Data structures
 *=======================================================================*/
    typedef struct JamApp
    {
        char *jarName;
        char *jarURL;
        char *appName;
        char *mainClass;
        char *version;
        struct JamApp *next;
    } JamApp;

/*=========================================================================
 * JAM functions
 *=======================================================================*/

    /*
     * Main function called from KVM main
     */
    extern int JamRunURL __FUNC_DECL((const char *, bool_t));

    /*
     * Application management functions (platform independent)
     */
#if COMPILER_SUPPORTS_DIR
    extern int JamInitialize __FUNC_DECL((char *));
#else 
    extern int JamInitialize __FUNC_DECL((void));
#endif /* end of #if COMPILER_SUPPORTS_DIR */
    extern int JamGetAppCount __FUNC_DECL((void));
    extern JamApp *JamGetAppList __FUNC_DECL((void));
    extern JamApp *JamGetCurrentApp __FUNC_DECL((void));
    extern void JamFreeApp __FUNC_DECL((JamApp *));
    extern char *JamGetProp __FUNC_DECL((char *, char *, int *));
    extern int JamCheckVersion __FUNC_DECL((char *, int));
    extern int JamCompareVersion __FUNC_DECL((char *, int, char *, int));
    extern void JamFinalize __FUNC_DECL((void));
    extern void strnzcpy __FUNC_DECL((char *, const char *, int));

    /*
     * Storage management functions (platform specific)
     */
#if COMPILER_SUPPORTS_DIR
    extern int JamInitializeStorage __FUNC_DECL((const char *));
#else 
    extern int JamInitializeStorage __FUNC_DECL((void));
#endif /* end of #if COMPILER_SUPPORTS_DIR */
    extern int JamGetFreeSpace __FUNC_DECL((void));
    extern int JamGetUsedSpace __FUNC_DECL((void));
    extern int JamGetTotalSpace __FUNC_DECL((void));
    extern int JamGetAppJarSize __FUNC_DECL((JamApp *));
    extern int JamGetAppTotalSize __FUNC_DECL((JamApp *));

    extern int JamOpenAppsDatabase __FUNC_DECL((void));
    extern JamApp *JamGetNextAppEntry __FUNC_DECL((void));
    extern void JamCloseAppsDatabase __FUNC_DECL((void));
    extern int JamSaveAppsDatabase __FUNC_DECL((void));

    extern int JamSaveJARFile __FUNC_DECL((JamApp *, char *, int));
    extern int JamDeleteJARFile __FUNC_DECL((JamApp *));

    /* Internal functions */
    extern char *JamGetAppsDir __FUNC_DECL((void));
    extern char *JamGetCurrentJar __FUNC_DECL((void));
    extern void JamInitializeUsedSpace __FUNC_DECL((JamApp *));

    extern char *browser_ckalloc(int size);
#define browser_malloc  midpMalloc
#define browser_free    midpFree

    extern int JamDownloadErrorPage __FUNC_DECL((int));
    extern int JamCheckSecurity __FUNC_DECL((char *, char *));
    extern int expandURL(char *, char *);

    extern int JamError __FUNC_DECL((char *));

    extern void JamFreeAppUsedSpace __FUNC_DECL((JamApp *));

    /* HTTP functions */
    extern int HTTP_Initialize __FUNC_DECL((void));
    extern char *HTTP_Get __FUNC_DECL((const char *, int *, int *, bool_t));
    extern void HTTP_Finalize __FUNC_DECL((void));

#ifdef __cplusplus__
}   /* extern "C" */
#endif 

#endif /* _JAM_H_ */ 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -