- implement sc_delete_record (Victor Tarasov)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1708 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
759ed8df49
commit
09b2730497
|
@ -799,6 +799,18 @@ int sc_update_record(struct sc_card *card, unsigned int rec_nr, const u8 * buf,
|
|||
SC_FUNC_RETURN(card->ctx, 2, r);
|
||||
}
|
||||
|
||||
int sc_delete_record(struct sc_card *card, unsigned int rec_nr)
|
||||
{
|
||||
int r;
|
||||
|
||||
assert(card != NULL);
|
||||
SC_FUNC_CALLED(card->ctx, 2);
|
||||
if (card->ops->delete_record == NULL)
|
||||
SC_FUNC_RETURN(card->ctx, 2, SC_ERROR_NOT_SUPPORTED);
|
||||
r = card->ops->delete_record(card, rec_nr);
|
||||
SC_FUNC_RETURN(card->ctx, 2, r);
|
||||
}
|
||||
|
||||
inline int sc_card_valid(const struct sc_card *card) {
|
||||
#ifndef NDEBUG
|
||||
assert(card != NULL);
|
||||
|
|
|
@ -578,6 +578,11 @@ struct sc_card_operations {
|
|||
|
||||
int (*get_data)(sc_card_t *, unsigned int, u8 *, size_t);
|
||||
int (*put_data)(sc_card_t *, unsigned int, const u8 *, size_t);
|
||||
|
||||
/* FIXME
|
||||
* Any of ISO-7816s contains this function?
|
||||
*/
|
||||
int (*delete_record)(sc_card_t *card, unsigned int rec_nr);
|
||||
};
|
||||
|
||||
struct sc_card_driver {
|
||||
|
@ -757,6 +762,7 @@ int sc_append_record(struct sc_card *card, const u8 * buf, size_t count,
|
|||
unsigned long flags);
|
||||
int sc_update_record(struct sc_card *card, unsigned int rec_nr, const u8 * buf,
|
||||
size_t count, unsigned long flags);
|
||||
int sc_delete_record(struct sc_card *card, unsigned int rec_nr);
|
||||
|
||||
/* get/put data functions */
|
||||
int sc_get_data(sc_card_t *, unsigned int, u8 *, size_t);
|
||||
|
|
Loading…
Reference in New Issue