[xplc-cvs] xplc/uuid/bin uuidgen.c,1.1,1.2
Cross-platform lightweight components
Status: Alpha
Brought to you by:
pphaneuf
From: Simon L. <sf...@us...> - 2005-10-21 14:17:16
|
Update of /cvsroot/xplc/xplc/uuid/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24491 Modified Files: uuidgen.c Log Message: Fix whitespace. Index: uuidgen.c =================================================================== RCS file: /cvsroot/xplc/xplc/uuid/bin/uuidgen.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** uuidgen.c 21 Oct 2005 13:18:22 -0000 1.1 --- uuidgen.c 21 Oct 2005 14:17:07 -0000 1.2 *************** *** 75,88 **** printf("Generate a new universally unique identifier (UUID)\n"); printf("\n" ! " -c, --cdef\toutput C structure for XPLC\n" ! " -r, --random\tgenerate random-based UUID\n" ! " -t, --time\tgenerate time-based UUID\n" ! " -u, --uuid\thuman-readable output\n" ! " --help\tdisplay this help and exit\n" ! " --version\toutput version information and exit\n" ! "\n"); printf("When called without options, this programme will generate a " ! "universally\n" ! "unique identifier (UUID), and output it as requested.\n"); } --- 75,88 ---- printf("Generate a new universally unique identifier (UUID)\n"); printf("\n" ! " -c, --cdef\toutput C structure for XPLC\n" ! " -r, --random\tgenerate random-based UUID\n" ! " -t, --time\tgenerate time-based UUID\n" ! " -u, --uuid\thuman-readable output\n" ! " --help\tdisplay this help and exit\n" ! " --version\toutput version information and exit\n" ! "\n"); printf("When called without options, this programme will generate a " ! "universally\n" ! "unique identifier (UUID), and output it as requested.\n"); } *************** *** 90,100 **** void print_version(const char* program) { printf("XPLC uuidgen version " PACKAGE_VERSION "\n" ! "Written by Simon Law.\n" ! "\n" ! "Copyright (C) 2005, Net Integration Technologies, Inc.\n" ! "This is free software; see the source for copying conditions. " ! "There is NO\n" ! "warranty; not even for MERCHANTABILITY or FITNESS FOR A " ! "PARTICULAR PURPOSE.\n"); } --- 90,100 ---- void print_version(const char* program) { printf("XPLC uuidgen version " PACKAGE_VERSION "\n" ! "Written by Simon Law.\n" ! "\n" ! "Copyright (C) 2005, Net Integration Technologies, Inc.\n" ! "This is free software; see the source for copying conditions. " ! "There is NO\n" ! "warranty; not even for MERCHANTABILITY or FITNESS FOR A " ! "PARTICULAR PURPOSE.\n"); } *************** *** 103,107 **** if(!cfg) { fprintf(stderr, ! "%s: Programmer error at %s:%d\n", program, __FILE__, __LINE__); abort(); } --- 103,107 ---- if(!cfg) { fprintf(stderr, ! "%s: Programmer error at %s:%d\n", program, __FILE__, __LINE__); abort(); } *************** *** 132,138 **** default: fprintf(stderr, ! "%s: invalid option -- %c\n" ! "Try `%s --help' for more information.\n", ! program, flag, program); return 1; } --- 132,138 ---- default: fprintf(stderr, ! "%s: invalid option -- %c\n" ! "Try `%s --help' for more information.\n", ! program, flag, program); return 1; } *************** *** 157,163 **** else { fprintf(stderr, ! "%s: unrecognised option `%s'\n" ! "Try `%s --help' for more information.\n", ! program, option, program); ret = 1; } --- 157,163 ---- else { fprintf(stderr, ! "%s: unrecognised option `%s'\n" ! "Try `%s --help' for more information.\n", ! program, option, program); ret = 1; } *************** *** 171,175 **** if(!cfg) { fprintf(stderr, ! "%s: Programmer error at %s:%d\n", program, __FILE__, __LINE__); abort(); } --- 171,175 ---- if(!cfg) { fprintf(stderr, ! "%s: Programmer error at %s:%d\n", program, __FILE__, __LINE__); abort(); } *************** *** 188,233 **** switch(state) { case PARSE_INVALID: ! fprintf(stderr, ! "%s: unrecognised option `%s'\n" ! "Try `%s --help' for more information.\n", ! program, argv[i], program); ! return 1; case PARSE_FLAGS: ! switch(*c) { ! case '-': ! state = PARSE_LONG_OPTION; ! break; ! default: ! state = PARSE_SHORT_OPTIONS; ! --c; ! } ! break; case PARSE_SHORT_OPTIONS: ! if(*c) { ! int ret = parse_short_option(*c, cfg); ! if(ret > 0) ! return ret; ! else if(ret < 0) ! return 0; ! } else ! c = NULL; ! break; case PARSE_LONG_OPTION: { ! int ret = parse_long_option(argv[i], cfg); ! if(ret > 0) ! return ret; ! else if(ret < 0) ! return 0; ! c = NULL; ! break; } default: ! switch(*c) { ! case '-': ! state = PARSE_FLAGS; ! break; ! default: ! state = PARSE_INVALID; ! } } } --- 188,233 ---- switch(state) { case PARSE_INVALID: ! fprintf(stderr, ! "%s: unrecognised option `%s'\n" ! "Try `%s --help' for more information.\n", ! program, argv[i], program); ! return 1; case PARSE_FLAGS: ! switch(*c) { ! case '-': ! state = PARSE_LONG_OPTION; ! break; ! default: ! state = PARSE_SHORT_OPTIONS; ! --c; ! } ! break; case PARSE_SHORT_OPTIONS: ! if(*c) { ! int ret = parse_short_option(*c, cfg); ! if(ret > 0) ! return ret; ! else if(ret < 0) ! return 0; ! } else ! c = NULL; ! break; case PARSE_LONG_OPTION: { ! int ret = parse_long_option(argv[i], cfg); ! if(ret > 0) ! return ret; ! else if(ret < 0) ! return 0; ! c = NULL; ! break; } default: ! switch(*c) { ! case '-': ! state = PARSE_FLAGS; ! break; ! default: ! state = PARSE_INVALID; ! } } } *************** *** 246,266 **** uuid_unparse(uuid, uuid_unparse_buf); ret = sscanf(uuid_unparse_buf, ! "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", ! &a, &b, &c, &d, &e, &f, &g, &h, &i, &j, &k); if(ret != 11) { uuid_unparse_buf[59] = '\0'; fprintf(stderr, ! "%s: libuuid error at %s:%d\n", program, __FILE__, __LINE__); fprintf(stderr, ! "uuid_unparse() returned `%s'.\n", uuid_unparse_buf); abort(); } sprintf(uuid_unparse_buf, ! "{0x%08x, " ! "0x%04x, " ! "0x%04x, " ! "{0x%02x, 0x%02x, " ! "0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x}}", ! a, b, c, d, e, f, g, h, i, j, k); return uuid_unparse_buf; } --- 246,266 ---- uuid_unparse(uuid, uuid_unparse_buf); ret = sscanf(uuid_unparse_buf, ! "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", ! &a, &b, &c, &d, &e, &f, &g, &h, &i, &j, &k); if(ret != 11) { uuid_unparse_buf[59] = '\0'; fprintf(stderr, ! "%s: libuuid error at %s:%d\n", program, __FILE__, __LINE__); fprintf(stderr, ! "uuid_unparse() returned `%s'.\n", uuid_unparse_buf); abort(); } sprintf(uuid_unparse_buf, ! "{0x%08x, " ! "0x%04x, " ! "0x%04x, " ! "{0x%02x, 0x%02x, " ! "0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x}}", ! a, b, c, d, e, f, g, h, i, j, k); return uuid_unparse_buf; } |