File: tutorial1a.c

package info (click to toggle)
libchipcard2 2.1.9-2
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 7,052 kB
  • ctags: 3,761
  • sloc: ansic: 53,628; xml: 11,689; sh: 8,909; makefile: 1,394; cpp: 400
file content (58 lines) | stat: -rw-r--r-- 1,362 bytes parent folder | download | duplicates (2)
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
57
58
/***************************************************************************
 $RCSfile$
                             -------------------
    cvs         : $Id: tutorial1a.c 163 2006-02-15 19:31:45Z aquamaniac $
    begin       : Mon Mar 01 2004
    copyright   : (C) 2004 by Martin Preuss
    email       : martin@libchipcard.de

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


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


/* You always need to include the header files of Libchipcard2 to work with
 * it ;-)
 */
#include <chipcard2/chipcard2.h>
#include <chipcard2-client/client/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", 0);
  LC_Client_ReadConfigFile(cl, 0);

  LC_Client_StartWait(cl, 0, 0);

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

  LC_Client_StopWait(cl);

  LC_Card_Open(card);

  LC_Card_Dump(card, stderr, 0);

  LC_Card_Close(card);

  LC_Card_free(card);
  LC_Client_free(cl);
  return 0;
}