1 /*****************************************************************************
2  * AreaFix library for Husky (FTN Software Package) callbacks and hooks
3  *****************************************************************************
4  * Copyright (C) 2003
5  *
6  * val khokhlov (Fido: 2:550/180), Kiev, Ukraine
7  *
8  * This file is part of Husky project.
9  *
10  * libareafix 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  * This library 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 libareafix; 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 #ifndef _CALLBACK_H
27 #define _CALLBACK_H
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #include <huskylib/compiler.h>
34 #include <huskylib/huskylib.h>
35 #include <fidoconf/fidoconf.h>
36 #include <fidoconf/arealist.h>
37 #include "areafix.h"
38 
39 /* set to &safe_strdup for hpt */
40 HUSKYEXT char* (*call_sstrdup)(const char *);
41 /* set to &safe_malloc for hpt */
42 HUSKYEXT void* (*call_smalloc)(size_t);
43 /* set to &safe_realloc for hpt */
44 HUSKYEXT void* (*call_srealloc)(void *, size_t);
45 
46 /* get area by name */
47 HUSKYEXT s_area* (*call_getArea)(char *);
48 /* validate a conference name */
49 HUSKYEXT int (*call_isValid)(const char *);
50 /* send a netmail message */
51 HUSKYEXT int (*call_sendMsg)(s_message *);
52 /* send a message to sysop */
53 HUSKYEXT int (*call_writeMsgToSysop)(s_message *);
54 /* return a pointer to robot's data in the link structure */
55 HUSKYEXT s_link_robot* (*call_getLinkRobot)(s_link *link);
56 
57 /* do program-dependent stuff when creating area (e.g. announce) */
58 /* possible usage: afReportAutoCreate */
59 HUSKYEXT void (*hook_onAutoCreate)(char *c_area, char *descr, hs_addr pktOrigAddr, ps_addr forwardAddr);
60 
61 /* do program-dependent stuff when deleting area (e.g. delete dupe base) */
62 /* possible usage: afDeleteArea */
63 HUSKYEXT int (*hook_onDeleteArea)(s_link *link, s_area *area);
64 
65 /* do program-dependent stuff when rescanning area */
66 /* possible usage: afRescanArea */
67 HUSKYEXT int (*hook_onRescanArea)(char **report, s_link *link, s_area *area, long rescanCount, long rescanAfter);
68 
69 /* call after config has been changed */
70 /* possible usage: perl_invalidate */
71 HUSKYEXT void (*hook_onConfigChange)(e_perlconftype configType);
72 
73 /* return 1 to use **report as %list result; 0 to use built-in */
74 /* possible usage: perl_echolist */
75 HUSKYEXT int (*hook_echolist)(char **report, s_listype type, ps_arealist al, char *aka);
76 
77 /* return 1 to use **report as cmd result; 0 to use built-in */
78 /* possible usage: perl_afixcmd */
79 HUSKYEXT int (*hook_afixcmd)(char **report, int cmd, char *aka, char *line);
80 
81 /* return 1 to update request originating address */
82 /* possible usage: perl_afixreq */
83 HUSKYEXT int (*hook_afixreq)(s_message *msg, hs_addr pktOrigAddr);
84 
85 /* return 1 to update robot's msg text and/or headers */
86 /* possible usage: perl_robotmsg */
87 HUSKYEXT int (*hook_robotmsg)(s_message *msg, char *type);
88 
89 #ifdef __cplusplus
90 }
91 #endif
92 
93 #endif
94