root / libsylph / base64.h @ 3050
History | View | Annotate | Download (1.3 kB)
| 1 | 528 | hiro | /*
|
|---|---|---|---|
| 2 | 578 | hiro | * LibSylph -- E-Mail client library |
| 3 | 578 | hiro | * Copyright (C) 1999-2005 Hiroyuki Yamamoto |
| 4 | 528 | hiro | * |
| 5 | 578 | hiro | * This library is free software; you can redistribute it and/or |
| 6 | 578 | hiro | * modify it under the terms of the GNU Lesser General Public |
| 7 | 578 | hiro | * License as published by the Free Software Foundation; either |
| 8 | 578 | hiro | * version 2.1 of the License, or (at your option) any later version. |
| 9 | 528 | hiro | * |
| 10 | 578 | hiro | * This library is distributed in the hope that it will be useful, |
| 11 | 528 | hiro | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | 578 | hiro | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | 578 | hiro | * Lesser General Public License for more details. |
| 14 | 528 | hiro | * |
| 15 | 578 | hiro | * You should have received a copy of the GNU Lesser General Public |
| 16 | 578 | hiro | * License along with this library; if not, write to the Free Software |
| 17 | 578 | hiro | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | 528 | hiro | */ |
| 19 | 528 | hiro | |
| 20 | 528 | hiro | #ifndef __BASE64_H__
|
| 21 | 528 | hiro | #define __BASE64_H__
|
| 22 | 528 | hiro | |
| 23 | 528 | hiro | #include <glib.h> |
| 24 | 528 | hiro | |
| 25 | 528 | hiro | typedef struct _Base64Decoder Base64Decoder; |
| 26 | 528 | hiro | |
| 27 | 528 | hiro | struct _Base64Decoder
|
| 28 | 528 | hiro | {
|
| 29 | 528 | hiro | gint buf_len; |
| 30 | 528 | hiro | gchar buf[4];
|
| 31 | 528 | hiro | }; |
| 32 | 528 | hiro | |
| 33 | 528 | hiro | void base64_encode (gchar *out,
|
| 34 | 528 | hiro | const guchar *in,
|
| 35 | 528 | hiro | gint inlen); |
| 36 | 528 | hiro | gint base64_decode (guchar *out, |
| 37 | 528 | hiro | const gchar *in,
|
| 38 | 528 | hiro | gint inlen); |
| 39 | 528 | hiro | |
| 40 | 528 | hiro | Base64Decoder *base64_decoder_new (void);
|
| 41 | 528 | hiro | void base64_decoder_free (Base64Decoder *decoder);
|
| 42 | 528 | hiro | gint base64_decoder_decode (Base64Decoder *decoder, |
| 43 | 528 | hiro | const gchar *in,
|
| 44 | 528 | hiro | guchar *out); |
| 45 | 528 | hiro | |
| 46 | 528 | hiro | #endif /* __BASE64_H__ */ |