gencppid.pl 371 Bytes
Newer Older
Tatiana Meshkova's avatar
Tatiana Meshkova committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/usr/bin/perl -w

my $val = `uuid`;
my $NAME = $ARGV[0];
if ($NAME && $val=~/(\S{8})\-(\S{4})\-(\S{4})-(\S{2})(\S{2})\-(\S{2})(\S{2})(\S{2})(\S{2})(\S{2})(\S{2})/) {
  print "
uuid - $val
#define $NAME \\
{ 0x$1, \\
  0x$2, \\
  0x$3, \\
  { 0x$4, 0x$5, 0x$6, 0x$7, 0x$8, 0x$9, 0x$10 }}
\n";
} else {
  print "Bad value provided.. use gencppid.pl NS_BLA_NAME_CID\n";
}