Grid Community Toolkit  6.2.1705709074 (tag: v6.2.20240202)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
test_common.h
1 /*
2  * Copyright 1999-2006 University of Chicago
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #if !defined(TEST_COMMON_H)
18 #define TEST_COMMON_H 1
19 
20 extern int verbose_print_level;
21 
22 typedef struct ftp_test_monitor_s
23 {
24  globus_mutex_t mutex;
25  globus_cond_t cond;
26  globus_bool_t done;
27  int count;
28  globus_result_t result;
29  void * user_arg;
30 } ftp_test_monitor_t;
31 
32 typedef struct globus_ftp_control_fake_file_t
33 {
34  globus_byte_t * buffer;
35  int chunk_size;
36  int file_size;
37  int offset;
38 } globus_ftp_control_fake_file_t;
39 
40 void
41 ftp_test_monitor_init(
42  ftp_test_monitor_t * monitor);
43 
44 void
45 ftp_test_monitor_reset(
46  ftp_test_monitor_t * monitor);
47 
48 void
49 ftp_test_monitor_done_wait(
50  ftp_test_monitor_t * monitor);
51 
52 void
53 ftp_test_monitor_count_wait(
54  ftp_test_monitor_t * monitor,
55  int count);
56 
57 void
58 ftp_test_monitor_signal(
59  ftp_test_monitor_t * monitor);
60 
61 void
62 help_print();
63 
64 void
65 fake_file_init(
66  globus_ftp_control_fake_file_t * fake_file,
67  int file_size,
68  int chunk_size);
69 
70 void
71 fake_file_destroy(
72  globus_ftp_control_fake_file_t * fake_file);
73 
75 fake_file_get_chunk(
76  globus_ftp_control_fake_file_t * fake_file,
77  int * size);
78 
80 fake_file_is_eof(
81  globus_ftp_control_fake_file_t * fake_file);
82 
84 fake_file_seek(
85  globus_ftp_control_fake_file_t * fake_file,
86  int offset);
87 
89 fake_file_cmp(
90  globus_ftp_control_fake_file_t * fake_file,
91  globus_byte_t * buffer,
92  int offset,
93  int length);
94 
95 void
96 verbose_printf(
97  int level,
98  char * s,
99  ...);
100 
102 pasv_to_host_port(
103  char * astr,
104  globus_ftp_control_host_port_t * addr);
105 
107 disconnect_control_handle(
108  globus_ftp_control_handle_t * control_handle);
110 connect_control_handle(
111  globus_ftp_control_handle_t * control_handle,
112  char * user_name,
113  char * password,
114  char * base_dir,
115  char * hostname,
116  unsigned short port);
117 
118 void
119 ftp_test_monitor_destroy(
120  ftp_test_monitor_t * monitor);
121 
122 #endif
int globus_bool_t
Boolean type.
Definition: globus_types.h:93
Mutex.
Definition: globus_thread.h:107
Condition variable.
Definition: globus_thread.h:124
unsigned char globus_byte_t
Unsigned byte datatypeThis is used for byte-addressable arrays of arbitrary data which is not subject...
Definition: globus_types.h:85
uint32_t globus_result_t
Definition: globus_types.h:99