/* insert/remove a new card. for removal, card == NULL  */
VReaderStatus vreader_insert_card(VReader *reader, VCard *card)
/* insert/remove a new card. for removal, card == NULL  */
VReaderStatus vreader_insert_card(VReader *reader, VCard *card)
{
    vreader_lock(reader);
    if (reader->card) {
        vcard_free(reader->card);
        reader->card = NULL;
    }
    reader->card = vcard_reference(card);
    vreader_unlock(reader);
    vreader_queue_card_event(reader);
    return VREADER_OK;
}