1 /* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 #include "apr_general.h"
24 int main(int argc, char **argv)
28 char buf[APR_UUID_FORMATTED_LENGTH + 1];
32 atexit(apr_terminate);
35 apr_uuid_format(buf, &uuid);
36 printf("UUID: %s\n", buf);
38 apr_uuid_parse(&uuid2, buf);
39 if (memcmp(&uuid, &uuid2, sizeof(uuid)) == 0)
40 printf("Parse appears to work.\n");
42 printf("ERROR: parse produced a different UUID.\n");
46 apr_uuid_format(buf, &uuid2);
47 printf("parsed/reformatted UUID: %s\n", buf);
49 /* generate two of them quickly */
52 apr_uuid_format(buf, &uuid);
53 printf("UUID 1: %s\n", buf);
54 apr_uuid_format(buf, &uuid2);
55 printf("UUID 2: %s\n", buf);