Annotation of win32/gnome/gmime-x.x.x/gmime-filter-yenc.h, revision 1.1

1.1     ! paf         1: /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
        !             2: /*
        !             3:  *  Authors: Jeffrey Stedfast <fejj@ximian.com>
        !             4:  *
        !             5:  *  Copyright 2002 Ximian, Inc. (www.ximian.com)
        !             6:  *
        !             7:  *  This program is free software; you can redistribute it and/or modify
        !             8:  *  it under the terms of the GNU General Public License as published by
        !             9:  *  the Free Software Foundation; either version 2 of the License, or
        !            10:  *  (at your option) any later version.
        !            11:  *
        !            12:  *  This program is distributed in the hope that it will be useful,
        !            13:  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
        !            14:  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        !            15:  *  GNU General Public License for more details.
        !            16:  *
        !            17:  *  You should have received a copy of the GNU General Public License
        !            18:  *  along with this program; if not, write to the Free Software
        !            19:  *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
        !            20:  *
        !            21:  */
        !            22: 
        !            23: 
        !            24: #ifndef __G_MIME_FILTER_YENC_H__
        !            25: #define __G_MIME_FILTER_YENC_H__
        !            26: 
        !            27: #ifdef __cplusplus
        !            28: extern "C" {
        !            29: //#pragma }
        !            30: #endif /* __cplusplus */
        !            31: 
        !            32: #include "gmime-filter.h"
        !            33: 
        !            34: typedef enum {
        !            35:        GMIME_FILTER_YENC_DIRECTION_ENCODE,
        !            36:        GMIME_FILTER_YENC_DIRECTION_DECODE,
        !            37: } GMimeFilterYencDirection;
        !            38: 
        !            39: #define GMIME_YDECODE_STATE_INIT     (0)
        !            40: #define GMIME_YENCODE_STATE_INIT     (0)
        !            41: 
        !            42: /* first 8 bits are reserved for saving a byte */
        !            43: 
        !            44: /* reserved for use only within g_mime_ydecode_step */
        !            45: #define GMIME_YDECODE_STATE_EOLN     (1 << 8)
        !            46: #define GMIME_YDECODE_STATE_ESCAPE   (1 << 9)
        !            47: 
        !            48: /* bits 10 and 11 reserved for later uses? */
        !            49: 
        !            50: #define GMIME_YDECODE_STATE_BEGIN    (1 << 12)
        !            51: #define GMIME_YDECODE_STATE_PART     (1 << 13)
        !            52: #define GMIME_YDECODE_STATE_DECODE   (1 << 14)
        !            53: #define GMIME_YDECODE_STATE_END      (1 << 15)
        !            54: 
        !            55: #define GMIME_YENCODE_CRC_INIT       (~0)
        !            56: #define GMIME_YENCODE_CRC_FINAL(crc) (~crc)
        !            57: 
        !            58: typedef struct _GMimeFilterYenc {
        !            59:        GMimeFilter parent;
        !            60:        
        !            61:        GMimeFilterYencDirection direction;
        !            62:        
        !            63:        int part;
        !            64:        
        !            65:        int state;
        !            66:        guint32 pcrc;
        !            67:        guint32 crc;
        !            68: } GMimeFilterYenc;
        !            69: 
        !            70: GMimeFilter *g_mime_filter_yenc_new (GMimeFilterYencDirection direction);
        !            71: 
        !            72: void g_mime_filter_yenc_set_state (GMimeFilterYenc *yenc, int state);
        !            73: void g_mime_filter_yenc_set_crc (GMimeFilterYenc *yenc, guint32 crc);
        !            74: 
        !            75: /*int     g_mime_filter_yenc_get_part (GMimeFilterYenc *yenc);*/
        !            76: guint32 g_mime_filter_yenc_get_pcrc (GMimeFilterYenc *yenc);
        !            77: guint32 g_mime_filter_yenc_get_crc (GMimeFilterYenc *yenc);
        !            78: 
        !            79: 
        !            80: size_t g_mime_ydecode_step  (const unsigned char *in, size_t inlen, unsigned char *out,
        !            81:                             int *state, guint32 *pcrc, guint32 *crc);
        !            82: size_t g_mime_yencode_step  (const unsigned char *in, size_t inlen, unsigned char *out,
        !            83:                             int *state, guint32 *pcrc, guint32 *crc);
        !            84: size_t g_mime_yencode_close (const unsigned char *in, size_t inlen, unsigned char *out,
        !            85:                             int *state, guint32 *pcrc, guint32 *crc);
        !            86: 
        !            87: #ifdef __cplusplus
        !            88: }
        !            89: #endif /* __cplusplus */
        !            90: 
        !            91: #endif /* __GMIME_FILTER_YENC_H__ */

E-mail: