Blame include/apr_uuid.h

Packit 383869
/* Licensed to the Apache Software Foundation (ASF) under one or more
Packit 383869
 * contributor license agreements.  See the NOTICE file distributed with
Packit 383869
 * this work for additional information regarding copyright ownership.
Packit 383869
 * The ASF licenses this file to You under the Apache License, Version 2.0
Packit 383869
 * (the "License"); you may not use this file except in compliance with
Packit 383869
 * the License.  You may obtain a copy of the License at
Packit 383869
 *
Packit 383869
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit 383869
 *
Packit 383869
 * Unless required by applicable law or agreed to in writing, software
Packit 383869
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit 383869
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 383869
 * See the License for the specific language governing permissions and
Packit 383869
 * limitations under the License.
Packit 383869
 */
Packit 383869
Packit 383869
/**
Packit 383869
 * @file apr_uuid.h
Packit 383869
 * @brief APR UUID library
Packit 383869
 */
Packit 383869
#ifndef APR_UUID_H
Packit 383869
#define APR_UUID_H
Packit 383869
Packit 383869
#include "apu.h"
Packit 383869
#include "apr_errno.h"
Packit 383869
Packit 383869
#ifdef __cplusplus
Packit 383869
extern "C" {
Packit 383869
#endif /* __cplusplus */
Packit 383869
Packit 383869
/**
Packit 383869
 * @defgroup APR_UUID UUID Handling
Packit 383869
 * @ingroup APR
Packit 383869
 * @{
Packit 383869
 */
Packit 383869
Packit 383869
/**
Packit 383869
 * we represent a UUID as a block of 16 bytes.
Packit 383869
 */
Packit 383869
Packit 383869
typedef struct {
Packit 383869
    unsigned char data[16]; /**< the actual UUID */
Packit 383869
} apr_uuid_t;
Packit 383869
Packit 383869
/** UUIDs are formatted as: 00112233-4455-6677-8899-AABBCCDDEEFF */
Packit 383869
#define APR_UUID_FORMATTED_LENGTH 36
Packit 383869
Packit 383869
Packit 383869
/**
Packit 383869
 * Generate and return a (new) UUID
Packit 383869
 * @param uuid The resulting UUID
Packit 383869
 */ 
Packit 383869
APU_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid);
Packit 383869
Packit 383869
/**
Packit 383869
 * Format a UUID into a string, following the standard format
Packit 383869
 * @param buffer The buffer to place the formatted UUID string into. It must
Packit 383869
 *               be at least APR_UUID_FORMATTED_LENGTH + 1 bytes long to hold
Packit 383869
 *               the formatted UUID and a null terminator
Packit 383869
 * @param uuid The UUID to format
Packit 383869
 */ 
Packit 383869
APU_DECLARE(void) apr_uuid_format(char *buffer, const apr_uuid_t *uuid);
Packit 383869
Packit 383869
/**
Packit 383869
 * Parse a standard-format string into a UUID
Packit 383869
 * @param uuid The resulting UUID
Packit 383869
 * @param uuid_str The formatted UUID
Packit 383869
 */ 
Packit 383869
APU_DECLARE(apr_status_t) apr_uuid_parse(apr_uuid_t *uuid, const char *uuid_str);
Packit 383869
Packit 383869
/** @} */
Packit 383869
#ifdef __cplusplus
Packit 383869
}
Packit 383869
#endif
Packit 383869
Packit 383869
#endif /* APR_UUID_H */