1 /*****************************************************************************
2  * HPUCODE --- Uuencoded files from FTN messagebase extractor
3  *****************************************************************************
4  * Copyright (C) 2002  Max Chernogor & Husky Team
5  *
6  * http://husky.sf.net
7  *
8  * This file is part of HUSKY fidonet package.
9  *
10  * HUSKY is free software; you can redistribute it and/or modify it
11  * under the terms of the GNU General Public License as published by the
12  * Free Software Foundation; either version 2, or (at your option) any
13  * later version.
14  *
15  * HUSKY is distributed in the hope that it will be useful, but
16  * WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with HPT; see the file COPYING.  If not, write to the Free
22  * Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
23  *****************************************************************************/
24 /* $Id$ */
25 
26 
27 #ifndef _HDECODER_H_
28 #define _HDECODER_H_
29 
30 #include <stdio.h>
31 #include <stdlib.h>
32 #include <string.h>
33 #include <smapi/msgapi.h>
34 #include <fidoconf/fidoconf.h>
35 #include <fidoconf/common.h>
36 #include <huskylib/xstr.h>
37 #include <huskylib/log.h>
38 #include <huskylib/tree.h>
39 
40 #define MAX              64
41 #define MAX_SECTIONS     10000
42 
43 #define DECODE_BYTE(b) ((b == 0x60) ? 0 : b - 0x20)
44 
45 typedef struct _DelCut
46 {
47     dword       nDelMsg;
48     UINT        nBegCut;
49     UINT        nEndCut;
50 } DelCutStruct ;
51 
52 typedef struct _UUEFile
53 {
54     char*           ID;
55     char*           m_fname;
56     int             m_nSections;
57     int             m_nAdded;
58     int             m_nPerm;
59     char**          UUEparts;
60     DelCutStruct*   toBeDeleted;
61     char*           description;
62     hs_addr         origin;
63 } UUEFile ;
64 
65 tree *UUEFileTree;
66 
67 
68 int processMsg(HAREA hArea, dword msgNumb, int scan_cut, UINT nBegCut, UINT nEndCut);
69 
70 UUEFile* MakeUUEFile(int nsec, char *name, char* ID);
71 
72 int      FreeUUEFile(char*);
73 int      CompareUUEFile(char*, char*);
74 
75 void AddPart(UUEFile* uuc, char* msgBody, char* uuepart, int section, int slen);
76 
77 int      nDelMsg;
78 int      nCutMsg;
79 DelCutStruct*   toBeDeleted;
80 dword    nMaxDeleted;
81 s_area   *currArea;
82 s_fidoconfig *config;
83 XMSG     xmsg;
84 dword    currMsgUid;
85 char*    versionStr;
86 int      lock_fd;
87 
88 
89 
90 #endif
91