1 /* $Id$ */
2 
3 /*****************************************************************************
4  * HPT --- FTN NetMail/EchoMail Tosser
5  *****************************************************************************
6  * Copyright (C) 1997-1999
7  *
8  * Matthias Tichy
9  *
10  * Fido:     2:2433/1245 2:2433/1247 2:2432/605.14
11  * Internet: mtt@tichy.de
12  *
13  * Grimmestr. 12         Buchholzer Weg 4
14  * 33098 Paderborn       40472 Duesseldorf
15  * Germany               Germany
16  *
17  * This file is part of HPT.
18  *
19  * HPT is free software; you can redistribute it and/or modify it
20  * under the terms of the GNU General Public License as published by the
21  * Free Software Foundation; either version 2, or (at your option) any
22  * later version.
23  *
24  * HPT is distributed in the hope that it will be useful, but
25  * WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27  * General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with HPT; see the file COPYING.  If not, write to the Free
31  * Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
32  *****************************************************************************/
33 #ifndef _FCOMMON_H
34 #define _FCOMMON_H
35 
36 #ifdef __NT__
37 #include <huskylib/typesize.h>
38 #endif
39 #include <stdio.h>
40 #include <fidoconf/fidoconf.h>
41 
42 
43 /* common functions */
44 void writeDupeFiles(void);
45 
46 
47 void exit_hpt(char *logstr, int print);
48 /*DOC
49   exit to shell with errorlevel 1.
50   print logstr to log file
51   print logstr to stderr if print!=0
52   closed log file, removed lockfile, disposed config
53 */
54 
55 void addAnotherPktFile(s_link *link, char *filename);
56 /*DOC
57   Input:  a pointer to a link structure, a pointer to a filename
58   FZ:     Adds the string pointed to by filename to the list off additional
59           pktfiles for the specified link. No checks are performed. The
60           string is duplicated internally.
61 */
62 
63 int   createTempPktFileName(s_link *link);
64 /*DOC
65   Input:  a pointer to a link structure
66   Output: 0 is returned if a pkt filename could be created.
67           1 else
68   FZ:     createTempPktFileName tries to compose a new, not used pktfilename.
69           It takes the least 24bit of the actual time. The last 2 Bytes
70           area filled with a counter. So you can get up to 256 different files
71           in a second and have the same timestamp only every 291 days.
72           The pktFileName is stored in the link structure
73 */
74 
75 int   createPackFileName(s_link *link);
76 /*DOC
77   Input:  a pointer to a link structure
78   Output: 0 is returned if a packedfilename could be created.
79           1 else
80   FZ:     createPackFileName tries to compose a new, not used packfilename.
81           Name depends of bundleNameStyle.
82           The the packFileName is stored in the link structure
83 */
84 
85 int    createOutboundFileName(s_link *link, e_flavour prio, e_pollType typ);
86 int    createOutboundFileNameAka(s_link *link, e_flavour prio, e_pollType typ, hs_addr *aka);
87 /*DOC
88   Input:  link is the link whose OutboundFileName should be created.
89           prio is some kind of CRASH, HOLD, NORMAL, DIRECT, IMMEDIATE
90           typ is some kind of PKT, REQUEST, FLOFILE
91   Output: a pointer to a char is returned.
92   FZ:     1 is returned if link is busy
93           0 else
94           */
95 
96 #if (defined ( __WATCOMC__ ) || defined ( __MINGW32__ )) && defined ( __NT__ )
97 int __stdcall SetConsoleTitleA( const char* lpConsoleTitle );
98 #endif
99 
100 #ifdef  HAS_IO_H
101 #include <io.h>
102 #endif
103 
104 void *safe_malloc(size_t size);
105 void *safe_calloc(size_t nmemb, size_t size);
106 void *safe_realloc(void *ptr, size_t size);
107 char *safe_strdup(const char *src);
108 
109 #endif
110 
111 void writeEchoTossLogEntry(char *areaName);
112