341
|
1 /*****************************************************************************/
|
|
2 /* gftpui.h - UI related functions for gFTP */
|
|
3 /* Copyright (C) 1998-2003 Brian Masney <masneyb@gftp.org> */
|
|
4 /* */
|
|
5 /* This program is free software; you can redistribute it and/or modify */
|
|
6 /* it under the terms of the GNU General Public License as published by */
|
|
7 /* the Free Software Foundation; either version 2 of the License, or */
|
|
8 /* (at your option) any later version. */
|
|
9 /* */
|
|
10 /* This program is distributed in the hope that it will be useful, */
|
|
11 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
|
12 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
|
13 /* GNU General Public License for more details. */
|
|
14 /* */
|
|
15 /* You should have received a copy of the GNU General Public License */
|
|
16 /* along with this program; if not, write to the Free Software */
|
|
17 /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA */
|
|
18 /*****************************************************************************/
|
|
19
|
|
20 /* $Id$ */
|
|
21
|
|
22 #ifndef __GFTPUI_H
|
|
23 #define __GFTPUI_H
|
|
24
|
|
25 #include "../../lib/gftp.h"
|
|
26
|
|
27 typedef struct _gftpui_callback_data gftpui_callback_data;
|
|
28
|
|
29 struct _gftpui_callback_data
|
|
30 {
|
|
31 gftp_request * request;
|
|
32 void *uidata;
|
|
33 char *input_string,
|
|
34 *source_string;
|
|
35 int (*run_function) (gftpui_callback_data * cdata);
|
|
36 };
|
|
37
|
|
38
|
|
39 typedef enum _gftpui_common_request_type
|
|
40 {
|
|
41 gftpui_common_request_none,
|
|
42 gftpui_common_request_local,
|
|
43 gftpui_common_request_remote
|
|
44 } gftpui_common_request_type;
|
|
45
|
|
46
|
|
47 typedef struct _gftpui_common_methods
|
|
48 {
|
|
49 char *command;
|
|
50 int minlen;
|
|
51 int (*func)(void *uidata, gftp_request * request, char *command);
|
|
52 gftpui_common_request_type reqtype;
|
|
53 char *cmd_description;
|
|
54 int (*subhelp_func) (char *topic);
|
|
55 } gftpui_common_methods;
|
|
56
|
|
57 #define gftpui_common_use_threads(request) (gftp_protocols[(request)->protonum].use_threads)
|
|
58
|
|
59 #define GFTPUI_COMMON_COLOR_BLACK "\033[30m"
|
|
60 #define GFTPUI_COMMON_COLOR_RED "\033[31m"
|
|
61 #define GFTPUI_COMMON_COLOR_GREEN "\033[32m"
|
|
62 #define GFTPUI_COMMON_COLOR_YELLOW "\033[33m"
|
|
63 #define GFTPUI_COMMON_COLOR_BLUE "\033[34m"
|
|
64 #define GFTPUI_COMMON_COLOR_MAGENTA "\033[35m"
|
|
65 #define GFTPUI_COMMON_COLOR_CYAN "\033[36m"
|
|
66 #define GFTPUI_COMMON_COLOR_WHITE "\033[37m"
|
|
67 #define GFTPUI_COMMON_COLOR_GREY "\033[38m"
|
|
68 #define GFTPUI_COMMON_COLOR_DEFAULT "\033[39m"
|
|
69 #define GFTPUI_COMMON_COLOR_NONE ""
|
|
70
|
|
71 extern sigjmp_buf gftpui_common_jmp_environment;
|
|
72 extern volatile int gftpui_common_use_jmp_environment;
|
|
73 extern gftpui_common_methods gftpui_common_commands[];
|
|
74
|
|
75 /* gftpui.c */
|
|
76 int gftpui_run_callback_function ( gftpui_callback_data * cdata );
|
|
77
|
|
78 int gftpui_common_run_callback_function ( gftpui_callback_data * cdata );
|
|
79
|
|
80 RETSIGTYPE gftpui_common_signal_handler ( int signo );
|
|
81
|
|
82 void gftpui_common_about ( gftp_logging_func logging_function,
|
|
83 gpointer logdata );
|
|
84
|
|
85 int gftpui_common_init ( void *locui,
|
|
86 gftp_request * locreq,
|
|
87 void *remui,
|
|
88 gftp_request * remreq );
|
|
89
|
|
90 int gftpui_common_process_command ( const char *command );
|
|
91
|
|
92 /* gftpuicallback.c */
|
|
93 int gftpui_common_run_mkdir ( gftpui_callback_data * cdata );
|
|
94
|
|
95 int gftpui_common_run_rename ( gftpui_callback_data * cdata );
|
|
96
|
|
97 int gftpui_common_run_site ( gftpui_callback_data * cdata );
|
|
98
|
|
99 int gftpui_common_run_chdir ( gftpui_callback_data * cdata );
|
|
100
|
|
101 /* UI Functions that must be implemented by each distinct UI */
|
|
102 void gftpui_lookup_file_colors ( gftp_file * fle,
|
|
103 char **start_color,
|
|
104 char ** end_color );
|
|
105
|
|
106 int gftpui_check_reconnect ( gftpui_callback_data * cdata );
|
|
107
|
|
108 void gftpui_refresh ( void *uidata );
|
|
109
|
|
110 void *gftpui_generic_thread ( void *(*run_function)(void *data),
|
|
111 void *data);
|
|
112
|
|
113 #endif
|