1/*
2 * Copyright (C) 2007 The Android Open Source Project
3 *
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
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17/**
18 * @file drm_decoder.h
19 *
20 * provide service to decode base64 data.
21 *
22 * <!-- #interface list begin -->
23 * \section drm decoder interface
24 * - drm_decodeBase64()
25 * <!-- #interface list end -->
26 */
27
28#ifndef __DRM_DECODER_H__
29#define __DRM_DECODER_H__
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include <drm_common_types.h>
36
37/**
38 * Decode base64
39 * \param dest          dest buffer to save decode base64 data
40 * \param destLen       dest buffer length
41 * \param src           source data to be decoded
42 * \param srcLen        source buffer length, and when return, give out how many bytes has been decoded
43 * \return
44 *        -when success, return a positive integer of dest buffer length,
45 *                       if input dest buffer is NULL or destLen is 0,
46 *                       return dest buffer length that user should allocate to save decoding data
47 *        -when failed, return -1
48 */
49int32_t drm_decodeBase64(uint8_t * dest, int32_t destLen, uint8_t * src, int32_t * srcLen);
50
51#ifdef __cplusplus
52}
53#endif
54
55#endif /* __DRM_DECODER_H__ */
56