?? tlv.h
字號:
#ifndef TLV__H/* ============================================================================ Project Name : jayaCard Module Name : proto/bios/lv/tlv.h Version : $Id: tlv.h,v 1.5 2004/01/11 09:56:31 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)/* get information about the TLV pointer by next_tlv / update also current_tlv and next_tlv*/jword __tlv_get_tag(void);#define TLV_GET_TAG() __tlv_get_tag()/* 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 + -