#!/usr/bin/perl -w if ($ARGV[0]) { $_ = $ARGV[0]; } else { $_ = `uuidgen`; } chomp; @matches = /([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{2})([0-9a-f]{2})-([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/; if (scalar(@matches) == 0) { die("Invalid uuid: $_"); } print "#define X_CID \\\n"; print "{ 0x$matches[0], 0x$matches[1], 0x$matches[2], \\\n"; print " { 0x$matches[3], 0x$matches[4], 0x$matches[5], 0x$matches[6], 0x$matches[7], 0x$matches[8], 0x$matches[9], 0x$matches[10] } }\n";