diff --git a/src/libopensc/opensc.h b/src/libopensc/opensc.h index 152b2ee2..aaae3044 100644 --- a/src/libopensc/opensc.h +++ b/src/libopensc/opensc.h @@ -1172,6 +1172,11 @@ struct sc_algorithm_info * sc_card_find_ec_alg(sc_card_t *card, struct sc_algorithm_info * sc_card_find_gostr3410_alg(sc_card_t *card, unsigned int key_length); +/** + * Used to initialize the @c sc_remote_data structure -- + * reset the header of the 'remote APDUs' list, set the handlers + * to manipulate the list. + */ void sc_remote_data_init(struct sc_remote_data *rdata); struct sc_card_error { diff --git a/src/libopensc/types.h b/src/libopensc/types.h index f49712ef..74624ada 100644 --- a/src/libopensc/types.h +++ b/src/libopensc/types.h @@ -309,7 +309,11 @@ typedef struct sc_serial_number { struct sc_iin iin; } sc_serial_number_t; -/* Data type used to send/get the data to/from the external (SM) moudules */ +/** + * @struct sc_remote_apdu data + * Structure to supply the linked APDU data used in + * communication with the external (SM) modules. + */ #define SC_REMOTE_APDU_FLAG_FATAL #define SC_REMOTE_APDU_FLAG_LAST #define SC_REMOTE_APDU_FLAG_RETURN_ANSWER @@ -324,11 +328,25 @@ struct sc_remote_apdu { struct sc_remote_apdu *next; }; +/** + * @struct sc_remote_data + * Frame for the list of the @c sc_remote_apdu data with + * the handlers to allocate and free. + */ struct sc_remote_data { struct sc_remote_apdu *data; int length; + /** + * Handler to allocate a new @c sc_remote_apdu data and add it to the list. + * @param rdata Self pointer to the @c sc_remote_data + * @param out Pointer to newle allocated member + */ int (*alloc)(struct sc_remote_data *rdata, struct sc_remote_apdu **out); + /** + * Handler to free the list of @c sc_remote_apdu data + * @param rdata Self pointer to the @c sc_remote_data + */ void (*free)(struct sc_remote_data *rdata); };