libgeda

s_encoding.c File Reference

#include <ctype.h>
#include <glib.h>
Include dependency graph for s_encoding.c:

Go to the source code of this file.

Defines

#define s_encoding_Pad64   '='

Functions

gchar * s_encoding_base64_encode (gchar *src, guint srclen, guint *dstlenp, gboolean strict)
 Convert a buffer from binary to base64 representation.
gchar * s_encoding_base64_decode (gchar *src, guint srclen, guint *dstlenp)
 Convert a buffer from base64 to binary representation.

Variables

static gchar s_encoding_Base64 [] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
static guchar s_encoding_Base64_rank [256]

Define Documentation

#define s_encoding_Pad64   '='

Definition at line 49 of file s_encoding.c.


Function Documentation

gchar* s_encoding_base64_encode ( gchar *  src,
guint  srclen,
guint *  dstlenp,
gboolean  strict 
)
Function Description
Convert a buffer from binary to base64 representation. Set strict to TRUE to insert a newline every 72th character. This is required by RFC 2045, but some applications don't require this.
Parameters:
[in]srcSource buffer.
[in]srclenLength of source buffer.
[out]dstlenpLength of buffer returned (including the terminating \0).
[in]strictInsert new lines as required by RFC 2045.
Returns:
Caller owned buffer containing base64 representation.

Definition at line 82 of file s_encoding.c.

gchar* s_encoding_base64_decode ( gchar *  src,
guint  srclen,
guint *  dstlenp 
)
Function Description
Convert a buffer from base64 to binary representation. This function is liberal in what it will accept. It ignores non-base64 symbols.
Parameters:
[in]srcSource buffer.
[in]srclenLength of the source buffer.
[out]dstlenpPointer to length of the destination buffer
Returns:
Caller-owned buffer with binary representation. The integer pointed to by dstlenp is set to the length of that buffer.

Definition at line 191 of file s_encoding.c.


Variable Documentation

gchar s_encoding_Base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" [static]
 ***********************************************************************
 *                   _     _                     __   _  _
 *   __ _ _ __   ___| |_  | |__   __ _ ___  ___ / /_ | || |
 *  / _` | '_ \ / _ \ __| | '_ \ / _` / __|/ _ \ '_ \| || |_
 * | (_| | | | |  __/ |_  | |_) | (_| \__ \  __/ (_) |__   _|
 *  \__, |_| |_|\___|\__| |_.__/ \__,_|___/\___|\___/   |_|
 *  |___/
 *
 *  created by Alfred Reibenschuh <alfredreibenschuh@gmx.net>,
 *  under the "GNU Library General Public License" (see below).
 *
 ***********************************************************************
 *
 * Copyright (C) 2003 Free Software Foundation
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02111-1301 USA.
 *
 ***********************************************************************
    

Taken from gnet's sources Modified the name of the functions and some variables

Definition at line 48 of file s_encoding.c.

guchar s_encoding_Base64_rank[256] [static]
Initial value:
 {
    255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 
    255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 
    255,255,255,255,255,255,255,255,255,255,255, 62,255,255,255, 63, 
     52, 53, 54, 55, 56, 57, 58, 59, 60, 61,255,255,255,255,255,255, 
    255,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 
     15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,255,255,255,255,255, 
    255, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 
     41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,255,255,255,255,255, 
    255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 
    255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 
    255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 
    255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 
    255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 
    255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 
    255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 
    255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 
}

Definition at line 50 of file s_encoding.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines