introspection.c

来自「一个免费的SMART CARD OS系统。」· C语言 代码 · 共 103 行

C
103
字号
/* ============================================================================   Project Name : jayaCard   Module Name  : proto/bios/simu/introspection.c   Version : $Id: introspection.c,v 1.5 2004/04/23 20:29:15 dgil Exp $	Description: a module for introspection of the BIOS/COS    The Original Code is jayaCard code.    The Initial Developer of the Original Code is Gilles Dumortier.	Portions created by the Initial Developer are Copyright (C) 2002-2004 the    Initial Developer. All Rights Reserved.    Contributor(s):    This program is free software; you can redistribute it and/or modify    it under the terms of the GNU General Public License as published by    the Free Software Foundation; either version 2 of the License, or    (at your option) any later version.    This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU General Public License for more details.    You should have received a copy of the GNU General Public License    along with this program; see http://www.gnu.org/licenses/gpl.html   History Rev	Description   020203 dgil	wrote it from scratch   050303 dgil	Move it to bios/simu   ============================================================================*/#include "precomp.h"/* ============================================================================	Local Globals   ========================================================================= */jbyte	gPrevEEPROM[SIMU_EEPROM_SIZE];jbool	gbFirstIntro = jtrue;/* ============================================================================	introspection()	eeprom:		compare new content vs previous content		update content for next introspection   ========================================================================= */void introspection(void){    if (LOG_ISENABLED("INTROSPECTION")) {        jint32  n;        jbool   bnewline;        jbool   bintros;        bintros = jfalse;        /* first introspection : make the initial image */        if (gbFirstIntro==jfalse) {            /* introspection of EEPROM */            bnewline = jtrue;            for (n=0; n<SIMU_EEPROM_SIZE;n++) {                if (gPrevEEPROM[n] != gEEPROM[n]) {                    if (!bintros) {                        printf("\nIntrospection >>>");                        bintros = jtrue;                    }                    if (bnewline) printf("\n0x%.6lX: ",n);                    bnewline = jfalse;                    #if defined(JAYACFG_EEPROM_INVERSED)                    printf("%.2X<%.2X ",LOBYTE(~gPrevEEPROM[n]),LOBYTE(~gEEPROM[n]));                    #else                    printf("%.2X<%.2X ",gPrevEEPROM[n],gEEPROM[n]);                    #endif                }                if (gPrevEEPROM[n] == gEEPROM[n]) {                    bnewline = jtrue;                }            }        }        /* introspection : make the image */        memcpy(gPrevEEPROM,gEEPROM,sizeof(gEEPROM));        gbFirstIntro = jfalse;        if (bintros) {            printf(" <<<\n");        }    }}/* =========================================================================	That's all folks !   ========================================================================= */

⌨️ 快捷键说明

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