File: makeSTDStyle

package info (click to toggle)
pcsc-lite 1.0.2.beta5-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,880 kB
  • ctags: 1,165
  • sloc: sh: 9,016; ansic: 6,752; lex: 219; makefile: 175; perl: 69
file content (54 lines) | stat: -rwxr-xr-x 1,361 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
#!/usr/bin/perl

print "makeSTDStyle - converts standard Apple Framework package sources\n \
       to MUSCLE winscard sources using wintypes.h\n\n";

$sedcommand = "sed 's^PCSC/wintypes.h^wintypes.h^g' | \
sed 's^PCSC/winscard.h^winscard.h^g' | sed 's^PCSC/pcsclite.h^pcsclite.h^g'";

$sedpcsclite = "sed 's^\#define PCSC_USE_WINTYPES FALSE^\#include \<wintypes.h\>^g'";

opendir(DIR, ".") || die "Cannot opendir .\n";
@dents = readdir(DIR);
closedir(DIR);

printf "Removing PCSC/ from winscard, wintypes, and pcsclite.h\n";

foreach $dent (@dents) {

 if ( $dent ne "test.c" ) {
  if ( $dent =~ /\.c/ ) {
    system("cat $dent | $sedcommand > tmpfile");
    system("mv tmpfile $dent");
    print "$dent\n"; 
  }

  if ( $dent =~ /configfile\.l/ ) {
    system("cat $dent | $sedcommand > tmpfile");
    system("mv tmpfile $dent");
    print "$dent\n"; 
  }

  if ( $dent =~ /pcsclite\.h/ ) {
    system("cat $dent | $sedcommand > tmpfile");
    system("mv tmpfile $dent");
    print "$dent\n"; 
  }

  if ( $dent =~ /winscard\.h/ ) {
    system("cat $dent | $sedcommand > tmpfile");
    system("mv tmpfile $dent");
    print "$dent\n"; 
  }
 }

}

# Remove include <wintypes.h> from pcsclite.h

    print "Adding wintypes.h to pcsclite.h\n\n";

    system("cat pcsclite.h | $sedpcsclite > tmpfile");
    system("mv tmpfile pcsclite.h");
    print "$dent\n";