File: tutorial1a.c

package info (click to toggle)
libchipcard 5.99.1beta-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 4,984 kB
  • sloc: ansic: 25,026; xml: 7,016; sh: 4,159; makefile: 954; cpp: 403
file content (56 lines) | stat: -rw-r--r-- 1,184 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/***************************************************************************
    begin       : Mon Mar 01 2004
    copyright   : (C) 2021 by Martin Preuss
    email       : martin@libchipcard.de

 ***************************************************************************
 *          Please see toplevel file COPYING for license details           *
 ***************************************************************************/


#ifdef HAVE_CONFIG_H
# include <config.h>
#endif


/* You always need to include the header files of Libchipcard2 to work with
 * it ;-)
 */
#include <libchipcard/chipcard.h>
#include <libchipcard/base/client.h>


/**
 * Please go to the source of this for a crosslinked view (see link below).
 * @callgraph
 */
int main(int argc, char **argv)
{
  LC_CLIENT *cl;
  LC_CARD *card;

  cl=LC_Client_new("tutorial1a", "1.0");
  LC_Client_Init(cl);

  LC_Client_Start(cl);

  fprintf(stderr, "Please insert a chip card.\n");
  LC_Client_GetNextCard(cl, &card, 30);

  LC_Client_Stop(cl);

  LC_Card_Open(card);

  LC_Card_Dump(card, 0);

  LC_Card_Close(card);
  LC_Client_ReleaseCard(cl, card);
  LC_Card_free(card);

  LC_Client_free(cl);
  return 0;
}