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

📄 tlv.h

📁 一个免费的SMART CARD OS系统。
💻 H
字号:
#ifndef TLV__H/* ============================================================================   Project Name : jayaCard   Module Name  : proto/bios/lv/tlv.h   Version : $Id: tlv.h,v 1.6 2004/04/23 20:29:15 dgil Exp $	Description: TLV (short TLV - tag length value)    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   050903 dgil	wrote it from scratch   ============================================================================*/#define TLV__H/* ============================================================================    Pointers used during the management of the TLV area   ========================================================================= */GLOBAL_XDATA(jword,next_tlv);			/* address of the next TLV */GLOBAL_XDATA(jword,current_tlv);		/* address of the current TLV */GLOBAL_XDATA(jword,current_tlv_tag);	/* Tag of the current TLV ber */GLOBAL_XDATA(jword,current_tlv_len);	/* Length of the current TLV ber */GLOBAL_XDATA(jword,current_tlv_val);	/* Value address of the current TLV ber *//* ============================================================================	API   ========================================================================= *//* initialise current_EF body to accept TLV management inside */void __tlv_init_area(void);#define TLV_INIT_AREA()			__tlv_init_area()/* return the number of bytes to encode a given tag length */jbyte	__tlv_size_of_length(jword len);#define TLV_SIZE_OF_LENGTH(len)	__tlv_size_of_length(len)/* Seek a tag in the current EF content. Returns jtrue if found and update   current_tlv_*, current_tlv and next_tlv according.*/#ifdef JAYACFG_DO_NOT_SUPPORT_RETURNTYPE_JBOOLjbyte __tlv_seek_first_tag(jword tag);#elsejbool __tlv_seek_first_tag(jword tag);#endif#define TLV_SEEK_FIRST_TAG(tag)	__tlv_seek_first_tag(tag)#ifdef JAYACFG_DO_NOT_SUPPORT_RETURNTYPE_JBOOLjbyte __tlv_seek_next_tag(jword tag);#elsejbool __tlv_seek_next_tag(jword tag);#endif#define TLV_SEEK_NEXT_TAG(tag)	__tlv_seek_next_tag(tag)/* ============================================================================	append a tag in the current EF body content		__tlv_append_tag() : seek the tag then append if not found		__tlv_append_inplace_tag() : seek has been done - append it now   ========================================================================= */#ifdef JAYACFG_DO_NOT_SUPPORT_RETURNTYPE_JBOOLjbyte __tlv_append_tag(jword tag,jword len,jbyte xdata * value);#elsejbool __tlv_append_tag(jword tag,jword len,jbyte xdata * value);#endif#define TLV_APPEND_TAG(tag,len,val)	__tlv_append_tag(tag,len,val)#ifdef JAYACFG_DO_NOT_SUPPORT_RETURNTYPE_JBOOLjbyte __tlv_append_inplace_tag(jword tag,jword len,jbyte xdata * value);#elsejbool __tlv_append_inplace_tag(jword tag,jword len,jbyte xdata * value);#endif#define TLV_APPEND_INPLACE_TAG(tag,len,val)	__tlv_append_inplace_tag(tag,len,val)/* ============================================================================	update a tag in the current EF body content		__tlv_update_tag() : seek the tag then update if found		__tlv_update_inplace_tag() : seek has been done - update it now   ========================================================================= */#ifdef JAYACFG_DO_NOT_SUPPORT_RETURNTYPE_JBOOLjbyte __tlv_update_tag(jword tag,jword len,jbyte xdata * value);#elsejbool __tlv_update_tag(jword tag,jword len,jbyte xdata * value);#endif#define TLV_UPDATE_TAG(tag,len,val)	__tlv_update_tag(tag,len,val)#ifdef JAYACFG_DO_NOT_SUPPORT_RETURNTYPE_JBOOLjbyte __tlv_update_inplace_tag(jword tag,jword len,jbyte xdata * value);#elsejbool __tlv_update_inplace_tag(jword tag,jword len,jbyte xdata * value);#endif#define TLV_UPDATE_INPLACE_TAG(tag,len,val)	__tlv_update_inplace_tag(tag,len,val)/* ============================================================================	Specific Tag   ========================================================================= */#define TAG_KEYFORMAT	0x62#define TAG_LISTOFDIR	0x70#define TAG_DIRENTRY	0x61/* ========================================================================= */#endif/* defined TLV__H */

⌨️ 快捷键说明

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