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

📄 property.c

📁 This is a java virtual machine implement in c
💻 C
字号:
/*0001*//*
/*0002./ * Copyright (c) 1998-2001 Sun Microsystems, Inc. All Rights Reserved.
/*0003./ *
/*0004./ * This software is the confidential and proprietary information of Sun
/*0005./ * Microsystems, Inc. ("Confidential Information").  You shall not
/*0006./ * disclose such Confidential Information and shall use it only in
/*0007./ * accordance with the terms of the license agreement you entered into
/*0008./ * with Sun.
/*0009./ *
/*0010./ * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
/*0011./ * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
/*0012./ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
/*0013./ * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
/*0014./ * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
/*0015./ * THIS SOFTWARE OR ITS DERIVATIVES.
/*0016./ *
/*0017./ */
/*0018*/
/*0019*//*=========================================================================
/*0020./ * KVM
/*0021./ *=========================================================================
/*0022./ * SYSTEM:    KVM
/*0023./ * SUBSYSTEM: Property support
/*0024./ * FILE:      property.c
/*0025./ * OVERVIEW:  System dependent property lookup operations and 
/*0026./ *            definitions.
/*0027./ * AUTHOR:    Nik Shaylor Sun C&E
/*0028./ *=======================================================================*/
/*0029*/
/*0030*//*=========================================================================
/*0031./ * Include files
/*0032./ *=======================================================================*/
/*0033*/
/*0034*/#include <global.h>
/*0035*/
/*0036*//*=========================================================================
/*0037./ * Functions
/*0038./ *=======================================================================*/
/*0039*/
/*0040*//*=========================================================================
/*0041./ * FUNCTION:      getSystemProperty()
/*0042./ * TYPE:          public operation
/*0043./ * OVERVIEW:      Return a value of a property key
/*0044./ * INTERFACE:
/*0045./ *   parameters:  char* key (as a C string (ASCIZ))
/*0046./ *   returns:     char* result (as a C string (ASCIZ))
/*0047./ *
/*0048./ * NOTE:          In the future, if the number of properties becomes
/*0049./ *                larger, we should create an internal hashtable for
/*0050./ *                properties.  Also, we should make it easy to extend
/*0051./ *                the set of system properties in port-specific files
/*0052./ *                without editing VmCommon files.
/*0053./ *=======================================================================*/
/*0054*/
/*0055*/char* getSystemProperty(char *key) {
/*0056*/    char* value = NULL;
/*0057*/
/*0058*/    /*
/*0059./     * Currently, we define properties simply by going
/*0060./     * through a set of if statements.  If the number of
/*0061./     * properties becomes any larger, we should really
/*0062./     * use an internal hashtable for the key/value pairs.
/*0063./     */
/*0064*/
/*0065*/    if (strcmp(key, "microedition.configuration") == 0) {
/*0066*/        /* Important: This value should reflect the */
/*0067*/        /* version of the CLDC Specification supported */
/*0068*/        /* -- not the version number of the implementation */
/*0069*/        value = "CLDC-1.0";
/*0070*/        goto done;
/*0071*/    }
/*0072*/
/*0073*/    if(strcmp(key, "microedition.platform") == 0) {
/*0074*/#ifdef PLATFORMNAME
/*0075*/        value = PLATFORMNAME;
/*0076*/        goto done;
/*0077*/#else
/*0078*/#ifdef PILOT
/*0079*/        value = "palm";
/*0080*/        goto done;
/*0081*/#endif
/*0082*/#endif
/*0083*/    }
/*0084*/
/*0085*/    if (strcmp(key, "microedition.encoding") == 0) {
/*0086*/        value = "ISO8859_1";
/*0087*/        goto done;
/*0088*/    }
/*0089*/
/*0090*/done:
/*0091*/    return value;
/*0092*/}
/*0093*/

⌨️ 快捷键说明

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