[Pcsclite-cvs-commit] Drivers/ccid/src/towitoko atr.h,1.2,1.3 atr.c,1.3,1.4
rousseau@haydn.debian.org
rousseau@haydn.debian.org
Update of /cvsroot/pcsclite/Drivers/ccid/src/towitoko
In directory haydn:/tmp/cvs-serv10632
Modified Files:
atr.h atr.c
Log Message:
remove unused functions
Index: atr.h
===================================================================
RCS file: /cvsroot/pcsclite/Drivers/ccid/src/towitoko/atr.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- atr.h 24 May 2004 12:58:43 -0000 1.2
+++ atr.h 30 Jun 2004 13:53:41 -0000 1.3
@@ -92,39 +92,17 @@
ATR;
/*
- * Exported variables declaration
- */
-
-extern unsigned atr_f_table[16];
-extern double atr_d_table[16];
-extern unsigned atr_i_table[4];
-
-/*
* Exported functions declaraton
*/
-/* Creation and deletion */
-extern ATR *ATR_New (void);
-extern void ATR_Delete (ATR * atr);
-
/* Initialization */
extern int ATR_InitFromArray (ATR * atr, BYTE buffer[ATR_MAX_SIZE], unsigned length);
/* General smartcard characteristics */
extern int ATR_GetConvention (ATR * atr, int *convention);
-extern int ATR_GetNumberOfProtocols (ATR * atr, unsigned *number_protocols);
-extern int ATR_GetProtocolType (ATR * atr, unsigned number_protocol, BYTE *protocol_type);
/* ATR parameters and integer values */
-extern int ATR_GetInterfaceByte (ATR * atr, unsigned number, int character, BYTE * ib);
extern int ATR_GetIntegerValue (ATR * atr, int name, BYTE * value);
extern int ATR_GetParameter (ATR * atr, int name, double *parameter);
-extern int ATR_GetHistoricalBytes (ATR * atr, BYTE * hist, unsigned *length);
-extern int ATR_GetCheckByte (ATR * atr, BYTE * check_byte);
-extern int ATR_GetFsMax (ATR * atr, unsigned long *fsmax);
-
-/* Raw ATR retrieving */
-extern int ATR_GetRaw (ATR * atr, BYTE * buffer, unsigned *lenght);
-extern int ATR_GetSize (ATR * atr, unsigned *size);
#endif /* _ATR_ */
Index: atr.c
===================================================================
RCS file: /cvsroot/pcsclite/Drivers/ccid/src/towitoko/atr.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- atr.c 30 Jun 2004 13:51:23 -0000 1.3
+++ atr.c 30 Jun 2004 13:53:41 -0000 1.4
@@ -61,17 +61,6 @@
* Exported funcions definition
*/
-ATR *
-ATR_New (void)
-{
- ATR *atr;
-
- /* Allocate memory */
- atr = (ATR *) malloc (sizeof (ATR));
-
- return atr;
-}
-
int
ATR_InitFromArray (ATR * atr, BYTE atr_buffer[ATR_MAX_SIZE], unsigned length)
{
@@ -185,13 +174,6 @@
return (ATR_OK);
}
-
-void
-ATR_Delete (ATR * atr)
-{
- free (atr);
-}
-
int
ATR_GetConvention (ATR * atr, int *convention)
{
@@ -205,53 +187,6 @@
}
int
-ATR_GetSize (ATR * atr, unsigned *size)
-{
- (*size) = atr->length;
- return (ATR_OK);
-}
-
-int
-ATR_GetNumberOfProtocols (ATR * atr, unsigned *number_protocols)
-{
- (*number_protocols) = atr->pn;
- return (ATR_OK);
-}
-
-int
-ATR_GetProtocolType (ATR * atr, unsigned number_protocol, BYTE *protocol_type)
-{
- if ((number_protocol > atr->pn) || number_protocol < 2)
- return ATR_NOT_FOUND;
-
- if (atr->ib[number_protocol - 2][ATR_INTERFACE_BYTE_TD].present)
- (*protocol_type) =
- (atr->ib[number_protocol - 2][ATR_INTERFACE_BYTE_TD].value & 0x0F);
- else
- (*protocol_type) = ATR_PROTOCOL_TYPE_T0;
-
- return (ATR_OK);
-}
-
-int
-ATR_GetInterfaceByte (ATR * atr, unsigned number, int character, BYTE * value)
-{
- if (number > atr->pn || number < 1)
- return (ATR_NOT_FOUND);
-
- if (atr->ib[number - 1][character].present &&
- (character == ATR_INTERFACE_BYTE_TA ||
- character == ATR_INTERFACE_BYTE_TB ||
- character == ATR_INTERFACE_BYTE_TC ||
- character == ATR_INTERFACE_BYTE_TD))
- (*value) = atr->ib[number - 1][character].value;
- else
- return (ATR_NOT_FOUND);
-
- return (ATR_OK);
-}
-
-int
ATR_GetIntegerValue (ATR * atr, int name, BYTE * value)
{
int ret;
@@ -380,78 +315,5 @@
}
return (ATR_NOT_FOUND);
-}
-
-int
-ATR_GetHistoricalBytes (ATR * atr, BYTE hist[ATR_MAX_HISTORICAL], unsigned *length)
-{
- if (atr->hbn == 0)
- return (ATR_NOT_FOUND);
-
- (*length) = atr->hbn;
- memcpy (hist, atr->hb, atr->hbn);
- return (ATR_OK);
-}
-
-int
-ATR_GetRaw (ATR * atr, BYTE buffer[ATR_MAX_SIZE], unsigned *length)
-{
- unsigned i, j;
-
- buffer[0] = atr->TS;
- buffer[1] = atr->T0;
-
- j = 2;
-
- for (i = 0; i < atr->pn; i++)
- {
- if (atr->ib[i][ATR_INTERFACE_BYTE_TA].present)
- buffer[j++] = atr->ib[i][ATR_INTERFACE_BYTE_TA].value;
-
- if (atr->ib[i][ATR_INTERFACE_BYTE_TB].present)
- buffer[j++] = atr->ib[i][ATR_INTERFACE_BYTE_TB].value;
-
- if (atr->ib[i][ATR_INTERFACE_BYTE_TC].present)
- buffer[j++] = atr->ib[i][ATR_INTERFACE_BYTE_TC].value;
-
- if (atr->ib[i][ATR_INTERFACE_BYTE_TD].present)
- buffer[j++] = atr->ib[i][ATR_INTERFACE_BYTE_TD].value;
- }
-
- if (atr->hbn > 0)
- {
- memcpy (&(buffer[j]), atr->hb, atr->hbn);
- j += atr->hbn;
- }
-
- if ((atr->TCK).present)
- buffer[j++] = (atr->TCK).value;
-
- (*length) = j;
-
- return ATR_OK;
-}
-
-int
-ATR_GetCheckByte (ATR * atr, BYTE * check_byte)
-{
- if (!((atr->TCK).present))
- return (ATR_NOT_FOUND);
-
- (*check_byte) = (atr->TCK).value;
- return (ATR_OK);
-}
-
-int
-ATR_GetFsMax (ATR * atr, unsigned long *fsmax)
-{
- BYTE FI;
-
- if (ATR_GetIntegerValue (atr, ATR_INTEGER_VALUE_FI, &FI) == ATR_OK)
- (*fsmax) = atr_fs_table[FI];
- else
- (*fsmax) = atr_fs_table[1];
-
- return (ATR_OK);
}