globus_common 18.14
Loading...
Searching...
No Matches
globus_states.h
Go to the documentation of this file.
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
22#if !defined(GLOBUS_STATES_H)
23#define GLOBUS_STATES_H 1
24
25#include "globus_common.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#define globus_state_add_transition(_h, _s, _e, _ns, _cb, _d) \
32globus_state_add_transition_real(_h, _s, _e, _ns, _cb, #_cb, _d)
33
34extern globus_extension_registry_t globus_i_state_diagram_registry;
35#define GLOBUS_STATE_DIAGRAM_REGISTRY &globus_i_state_diagram_registry
36
37typedef struct globus_i_state_handle_s * globus_state_handle_t;
38
39typedef
41(*globus_states_transition_function_t)(
42 int new_state,
43 void * user_arg);
44
45typedef
46void
47(*globus_states_transition_error_function_t)(
48 int new_state,
49 void * user_arg);
50
51typedef
53(*globus_states_init_function_t)(
54 globus_state_handle_t handle);
55
56typedef struct globus_state_extension_handle_s
57{
58 globus_states_init_function_t init_handler;
59 char * name;
60} globus_state_extension_handle_t;
61
62
63
64typedef enum globus_state_dia_flags_e
65{
66 GLOBUS_STATE_DIA_EDGE_EVENT = 1,
67 GLOBUS_STATE_DIA_EDGE_FUNC = 2,
68 GLOBUS_STATE_DIA_NO_DUPLICATES = 4,
69 GLOBUS_STATE_DIA_NUMBER_LABELS = 8
70} globus_state_dia_flags_t;
71
73globus_states_set_events(
74 globus_state_handle_t handle,
75 int state_count,
76 int event_count,
77 char * reg_name,
78 char ** state_name,
79 char ** event_name);
80
82globus_states_init(
83 globus_state_handle_t * out_handle,
84 globus_states_init_function_t init_func);
85
87globus_state_add_transition_real(
88 globus_state_handle_t in_handle,
89 int state,
90 int event,
91 int new_state,
92 globus_states_transition_function_t cb,
93 char * edge_name,
94 char * desc);
95
96
98globus_state_handle_event_now(
99 globus_state_handle_t in_handle,
100 int state,
101 int event,
102 void * user_arg);
103
105globus_state_queue_event(
106 globus_state_handle_t in_handle,
107 int state,
108 int event,
109 void * user_arg,
110 globus_states_transition_error_function_t error_event);
111
112
113
115globus_state_destroy(
116 globus_state_handle_t in_handle);
117
119globus_state_make_graph(
120 globus_state_handle_t in_handle,
121 const char * filename,
122 const char * txt_filename,
123 int flags,
124 char * user_desc);
125
126#ifdef __cplusplus
127}
128#endif
129
130#endif
Headers common to all of Globus.
uint32_t globus_result_t
Definition globus_types.h:99