]>
git.proxmox.com Git - ceph.git/blob - ceph/src/common/mime.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2011 New Dream Network
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
15 #ifndef CEPH_COMMON_MIME_H
16 #define CEPH_COMMON_MIME_H
22 /* Encode a buffer as quoted-printable.
24 * The input is a null-terminated string.
25 * The output is a null-terminated string representing the input encoded as
26 * a MIME quoted-printable.
28 * Returns the length of the buffer we would need to do the encoding.
29 * If we don't have enough buffer space, the output will be truncated.
31 * You may call mime_encode_as_qp(input, NULL, 0) to find the size of the
32 * buffer you will need.
34 signed int mime_encode_as_qp(const char *input
, char *output
, int outlen
);
36 /* Decode a quoted-printable buffer.
38 * The input is a null-terminated string encoded as a MIME quoted-printable.
39 * The output is a null-terminated string representing the input decoded.
41 * Returns a negative error code if the input is not a valid quoted-printable
43 * Returns the length of the buffer we would need to do the encoding.
44 * If we don't have enough buffer space, the output will be truncated.
46 * You may call mime_decode_as_qp(input, NULL, 0) to find the size of the
47 * buffer you will need. The output will never be longer than the input for
50 signed int mime_decode_from_qp(const char *input
, char *output
, int outlen
);