Grid Community Toolkit  6.2.1705709074 (tag: v6.2.20240202)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
globus_xio_load.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 #ifndef GLOBUS_XIO_LOAD_INCLUDE
18 #define GLOBUS_XIO_LOAD_INCLUDE
19 
20 #include "globus_xio_types.h"
21 #include "globus_common.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 extern globus_extension_registry_t globus_i_xio_driver_registry;
28 #define GLOBUS_XIO_DRIVER_REGISTRY &globus_i_xio_driver_registry
29 
30 typedef
32 (*globus_xio_driver_init_t)(
33  globus_xio_driver_t * out_driver);
34 
35 typedef
36 void
37 (*globus_xio_driver_destroy_t)(
38  globus_xio_driver_t driver);
39 
40 typedef struct
41 {
42  const char * name;
43  globus_xio_driver_init_t init;
44  globus_xio_driver_destroy_t destroy;
45 } globus_xio_driver_hook_t;
46 
48 globus_xio_driver_load(
49  const char * driver_name,
50  globus_xio_driver_t * out_driver);
51 
53 globus_xio_driver_unload(
54  globus_xio_driver_t driver);
55 
65 #define GlobusXIODefineDriver(driver_name, init_func, destroy_func) \
66 globus_xio_driver_hook_t globus_i_xio_##driver_name##_hook = \
67 { \
68  #driver_name, \
69  init_func, \
70  destroy_func, \
71 }
72 #define GlobusXIODeclareDriver(driver_name) \
73  extern globus_xio_driver_hook_t globus_i_xio_##driver_name##_hook
74 #define GlobusXIOMyDriver(driver_name) \
75  &globus_i_xio_##driver_name##_hook
76 
83 #define GlobusXIORegisterDriver(driver_name) \
84  globus_extension_registry_add( \
85  GLOBUS_XIO_DRIVER_REGISTRY, \
86  (void *)#driver_name, \
87  GlobusXIOMyModule(driver_name), \
88  GlobusXIOMyDriver(driver_name))
89 #define GlobusXIOUnRegisterDriver(driver_name) \
90  globus_extension_registry_remove( \
91  GLOBUS_XIO_DRIVER_REGISTRY, \
92  (void*)#driver_name)
93 
94 #define GlobusXIODefineModule(driver_name) \
95  GlobusExtensionDefineModule(globus_xio_##driver_name##_driver)
96 #define GlobusXIODeclareModule(driver_name) \
97  GlobusExtensionDeclareModule(globus_xio_##driver_name##_driver)
98 #define GlobusXIOMyModule(driver_name) \
99  GlobusExtensionMyModule(globus_xio_##driver_name##_driver)
100 #define GlobusXIOExtensionName(driver_name) \
101  "globus_xio_" #driver_name "_driver"
102 
103 #define GLOBUS_XIO_EXTENSION_FORMAT "globus_xio_%s_driver"
104 
105 /* internal activate funcs */
106 int
107 globus_i_xio_load_init(void);
108 
109 int
110 globus_i_xio_load_destroy(void);
111 
112 #ifdef __cplusplus
113 }
114 #endif
115 
116 #endif
Headers common to all of Globus.
uint32_t globus_result_t
Definition: globus_types.h:99