UUID functions renamed to avoid conflict with Mac OS X system functions
[public/netxms.git] / src / tools / nxgenguid / nxgenguid.cpp
1 /*
2 ** nxgenguid - command line tool for GUID generation
3 ** Copyright (C) 2004-2015 Victor Kirhenshtein
4 **
5 ** This program is free software; you can redistribute it and/or modify
6 ** it under the terms of the GNU General Public License as published by
7 ** the Free Software Foundation; either version 2 of the License, or
8 ** (at your option) any later version.
9 **
10 ** This program is distributed in the hope that it will be useful,
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ** GNU General Public License for more details.
14 **
15 ** You should have received a copy of the GNU General Public License
16 ** along with this program; if not, write to the Free Software
17 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 **
19 ** File: nxgenguid.cpp
20 **
21 **/
22
23 #include <nms_util.h>
24 #include <uuid.h>
25
26 /**
27 * main
28 */
29 int main(int argc, char *argv[])
30 {
31 int ch;
32
33 // Parse command line
34 opterr = 1;
35 while((ch = getopt(argc, argv, "hK:va")) != -1)
36 {
37 switch(ch)
38 {
39 case 'h': // Display help and exit
40 printf("Usage: nxgenguid [<options>]\n"
41 "Valid options are:\n"
42 " -h : Display help and exit.\n"
43 " -v : Display version and exit.\n"
44 "\n");
45 return 0;
46 case 'v': // Print version and exit
47 printf("NetXMS GUID Generation Tool Version " NETXMS_VERSION_STRING_A "\n");
48 return 0;
49 case '?':
50 return 1;
51 default:
52 break;
53 }
54 }
55
56 _putts(uuid::generate().toString());
57 return 0;
58 }