File: browsewrap.h

package info (click to toggle)
linneighborhood 0.6.5-3.1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,312 kB
  • ctags: 2,315
  • sloc: ansic: 21,717; sh: 2,984; yacc: 318; makefile: 312
file content (202 lines) | stat: -rw-r--r-- 6,968 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202

/* LinNeighborhood
 * Copyright (c) 1999-2002 Richard Stemmer and Hans Schmid
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef _browsewrap_h_
#define _browsewrap_h_

#ifdef __cplusplus
extern "C" {
#endif

#include "define.h"

/* ------------------------------------------------------------------------- */

typedef void (*browse_groups_callback)(GSList *groupmasterlist,
                                       BROWSE_MODE mode);

typedef void (*browse_machines_callback)( char *group_name,
                                       GSList * machinecommentlist,
                                       BROWSE_MODE mode);

typedef void (*browse_shares_callback)(char *group_name,
                                       char *machine_name,
                                       char *user,
                                       char *password,
                                       MACHINEINFO_STRUCT *machineinfo,
                                       GSList *sharecommenttypelist,
                                       BROWSE_MODE mode);

typedef void (*browse_path_callback)(  char *group_name,
                                       char *machine_name,
                                       char *share_name,
                                       char *path_name,
                                       GSList *files,
                                       BROWSE_MODE mode);

typedef void (*browse_network_wait_callback)(void);

typedef struct _GROUPS_BROWSE_INFO {
        BROWSE_MODE mode;
        unsigned int browse_id;
        browse_groups_callback callback;
} GROUPS_BROWSE_INFO;

typedef struct _MACHINES_BROWSE_INFO {
        BROWSE_MODE mode;
        unsigned int browse_id;
        browse_machines_callback callback;
} MACHINES_BROWSE_INFO;

typedef struct _SHARES_BROWSE_INFO {
        BROWSE_MODE mode;
        unsigned int browse_id;
        browse_shares_callback callback;
} SHARES_BROWSE_INFO;

typedef struct _PATH_BROWSE_INFO {
        BROWSE_MODE mode;
        unsigned int browse_id;
        browse_path_callback callback;
} PATH_BROWSE_INFO;

typedef union _BROWSE_INFO {
        GROUPS_BROWSE_INFO g_info;
        MACHINES_BROWSE_INFO h_info;
        SHARES_BROWSE_INFO s_info;
        PATH_BROWSE_INFO p_info;
} BROWSE_INFO;

/* ------------------------------------------------------------------------- */

typedef struct _BL_REFERENCE {
        unsigned int type;
        BROWSE_MODE mode;
} BL_REFERENCE;

typedef struct _BL_GROUPS_ENTRY {
        unsigned int type;
        BROWSE_MODE mode;
        char group[MAXGROUPNAMEL+1];
        char browser[MAXMACHNAMEL+1];
        browse_groups_callback callback;
} BL_GROUPS_ENTRY;

typedef struct _BL_MACHINES_ENTRY {
        unsigned int type;
        BROWSE_MODE mode;
        char group[MAXGROUPNAMEL+1];
        char master[MAXMACHNAMEL+1];
        char domain[MAXGROUPNAMEL+1];
        browse_machines_callback callback;
} BL_MACHINES_ENTRY;

typedef struct _BL_SHARES_ENTRY {
        unsigned int type;
        BROWSE_MODE mode;
        char group[MAXGROUPNAMEL+1];
        char machine[MAXMACHNAMEL+1];
        char domain[MAXGROUPNAMEL+1];
        char ip[MAXIPL+1];
        browse_shares_callback callback;
} BL_SHARES_ENTRY;

typedef struct _BL_PATH_ENTRY {
        unsigned int type;
        BROWSE_MODE mode;
        char group[MAXGROUPNAMEL+1];
        char machine[MAXMACHNAMEL+1];
        char domain[MAXGROUPNAMEL+1];
        char ip[MAXIPL+1];
        char path[MAXSHAREPATHL+1];
        char user[USER_LEN+1];
        char password[PASSWORD_LEN+1];
        browse_path_callback callback;
} BL_PATH_ENTRY;

typedef union _BROWSE_LIST_ENTRY {
        BL_REFERENCE r_entry;
        BL_GROUPS_ENTRY g_entry;
        BL_MACHINES_ENTRY h_entry;
        BL_SHARES_ENTRY s_entry;
        BL_PATH_ENTRY p_entry;
} BROWSE_LIST_ENTRY;

/* ------------------------------------------------------------------------- */

extern void GetSMBGroups_done ( GSList *groupmasterlist,
                                GROUPS_BROWSE_INFO *browse_info,
                                GetSMBStateType state );

extern void GetSMBMachines_done  ( char *group_name,
                                   GSList *machinecommentlist,
                                   MACHINES_BROWSE_INFO *browse_info,
                                   GetSMBStateType state );

extern void GetSMBShares_done ( char *group_name,
                                char *machine_name,
                                char *user,
                                char *password,
                                MACHINEINFO_STRUCT *machineinfo,
                                GSList *sharecommenttypelist,
                                SHARES_BROWSE_INFO *browse_info,
                                GetSMBStateType state );

extern void GetSMBPath_done (   char *group_name,
                                char *machine_name,
                                char *share_name,
                                char *path_name,
                                GSList *files,
                                PATH_BROWSE_INFO *browse_info,
                                GetSMBStateType state);

extern void LookupByName_done (char * machine_name, char *group_name, char *ipaddr,GetSMBStateType state);
extern void LookupByIP_done ( char *ipaddr,char * machine_name, char *group_name,GetSMBStateType state);

/* ------------------------------------------------------------------------- */

/* initialization functions */
extern void browse_init ();
extern void browse_clean ();

/* browse limit functions */
extern unsigned int browse_job_get_max ();
extern void browse_job_set_max (unsigned int jobs);

/* browsing functions */
extern void browse_groups ( BROWSE_MODE mode );

extern unsigned char browse_machines ( char *groupname,
                                       BROWSE_MODE mode);

extern void browse_shares ( char *groupname, char *machinename,
                            BROWSE_MODE mode);

extern void browse_path (share_window_struct *sw, BROWSE_MODE mode);

extern void browse_network (BROWSE_MODE mode);
extern void browse_network_wait_done (browse_network_wait_callback callback);

/* ------------------------------------------------------------------------- */

#ifdef __cplusplus
}
#endif

#endif  /* _browsewrap_h_ */