~ps10gel/ubuntu/xenial/trafficserver/6.2.0

« back to all changes in this revision

Viewing changes to lib/ts/ink_base64.h

  • Committer: Bazaar Package Importer
  • Author(s): Arno Toell
  • Date: 2011-01-13 11:49:18 UTC
  • Revision ID: james.westby@ubuntu.com-20110113114918-vu422h8dknrgkj15
Tags: upstream-2.1.5-unstable
ImportĀ upstreamĀ versionĀ 2.1.5-unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/** @file
 
2
 
 
3
  A brief file description
 
4
 
 
5
  @section license License
 
6
 
 
7
  Licensed to the Apache Software Foundation (ASF) under one
 
8
  or more contributor license agreements.  See the NOTICE file
 
9
  distributed with this work for additional information
 
10
  regarding copyright ownership.  The ASF licenses this file
 
11
  to you under the Apache License, Version 2.0 (the
 
12
  "License"); you may not use this file except in compliance
 
13
  with the License.  You may obtain a copy of the License at
 
14
 
 
15
      http://www.apache.org/licenses/LICENSE-2.0
 
16
 
 
17
  Unless required by applicable law or agreed to in writing, software
 
18
  distributed under the License is distributed on an "AS IS" BASIS,
 
19
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
20
  See the License for the specific language governing permissions and
 
21
  limitations under the License.
 
22
 */
 
23
 
 
24
#ifndef _ink_base64_h_
 
25
#define _ink_base64_h_
 
26
#include "ink_apidefs.h"
 
27
/*
 
28
 * Base64 encoding and decoding as according to RFC1521.  Similar to uudecode.
 
29
 * See RFC1521 for specificiation.
 
30
 *
 
31
 * RFC 1521 requires inserting line breaks for long lines.  The basic web
 
32
 * authentication scheme does not require them.  This implementation is
 
33
 * intended for web-related use, and line breaks are not implemented.
 
34
 *
 
35
 * These routines return char*'s to malloc-ed strings.  The caller is
 
36
 * responsible for freeing the strings.
 
37
 *
 
38
 */
 
39
 
 
40
// These functions return xmalloc'd memory which caller needs to xfree
 
41
inkcoreapi char *ink_base64_decode(const char *input, int input_len, int *output_len);
 
42
char *ink_base64_encode(const char *input, int input_len, int *output_len);
 
43
char *ink_base64_encode_unsigned(const unsigned char *input, int input_len, int *output_len);
 
44
 
 
45
// Decodes into user supplied buffer.  Returns number of bytes decoded
 
46
inkcoreapi int ink_base64_decode(const char *inBuffer, int outBufSize, unsigned char *outBuffer);
 
47
int ink_base64_uuencode(const char *bufin, int nbytes, unsigned char *outBuffer);
 
48
 
 
49
#endif