Grid Community Toolkit  6.2.1705709074 (tag: v6.2.20240202)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
globus_scheduler_event_generator.h
1 /*
2  * Copyright 1999-2014 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_SCHEDULER_EVENT_GENERATOR_H
18 #define GLOBUS_SCHEDULER_EVENT_GENERATOR_H
19 
20 #include "globus_common.h"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #ifndef GLOBUS_GLOBAL_DOCUMENT_SET
27 
31 #endif
32 
49 typedef enum
50 {
63 }
65 
66 #if __STDC_VERSION__ == 199901L
67 # define MYNAME __func__
68 #elif defined(__GNUC__)
69 # define MYNAME __FUNCTION__
70 #else
71 # define MYNAME ""
72 #endif
73 
74 typedef void (*globus_scheduler_event_generator_fault_t)(
75  void * user_arg,
76  globus_result_t fault);
77 
78 #define GLOBUS_SEG_ERROR_NULL_OBJECT() \
79  globus_error_construct_error(GLOBUS_SCHEDULER_EVENT_GENERATOR_MODULE, \
80  NULL, \
81  GLOBUS_SEG_ERROR_TYPE_NULL, \
82  __FILE__, \
83  MYNAME, \
84  __LINE__, \
85  "Null parameter")
86 
87 #define GLOBUS_SEG_ERROR_ALREADY_SET_OBJECT() \
88  globus_error_construct_error(GLOBUS_SCHEDULER_EVENT_GENERATOR_MODULE, \
89  NULL, \
90  GLOBUS_SEG_ERROR_TYPE_ALREADY_SET, \
91  __FILE__, \
92  MYNAME, \
93  __LINE__, \
94  "Value already set")
95 
96 #define GLOBUS_SEG_ERROR_INVALID_MODULE_OBJECT(module, errmsg) \
97  globus_error_construct_error(GLOBUS_SCHEDULER_EVENT_GENERATOR_MODULE, \
98  NULL, \
99  GLOBUS_SEG_ERROR_TYPE_INVALID_MODULE, \
100  __FILE__, \
101  MYNAME, \
102  __LINE__, \
103  "Invalid module %s: %s", \
104  module, \
105  errmsg)
106 
107 #define GLOBUS_SEG_ERROR_INVALID_FORMAT_OBJECT(fmt) \
108  globus_error_construct_error(GLOBUS_SCHEDULER_EVENT_GENERATOR_MODULE, \
109  NULL, \
110  GLOBUS_SEG_ERROR_TYPE_INVALID_FORMAT, \
111  __FILE__, \
112  MYNAME, \
113  __LINE__, \
114  "Invalid format %s", \
115  fmt)
116 
117 #define GLOBUS_SEG_ERROR_OUT_OF_MEMORY_OBJECT() \
118  globus_error_construct_error(GLOBUS_SCHEDULER_EVENT_GENERATOR_MODULE, \
119  NULL, \
120  GLOBUS_SEG_ERROR_TYPE_OUT_OF_MEMORY, \
121  __FILE__, \
122  MYNAME, \
123  __LINE__, \
124  "Out of memory")
125 
126 #define GLOBUS_SEG_ERROR_LOADING_MODULE_OBJECT(module, dlerr_msg) \
127  globus_error_construct_error(GLOBUS_SCHEDULER_EVENT_GENERATOR_MODULE, \
128  NULL, \
129  GLOBUS_SEG_ERROR_TYPE_LOADING_MODULE, \
130  __FILE__, \
131  MYNAME, \
132  __LINE__, \
133  "Unable to dlopen module \"%s\": %s", \
134  module, \
135  dlerr_msg)
136 
137 #define GLOBUS_SEG_ERROR_NULL \
138  globus_error_put(GLOBUS_SEG_ERROR_NULL_OBJECT())
139 
140 #define GLOBUS_SEG_ERROR_ALREADY_SET \
141  globus_error_put(GLOBUS_SEG_ERROR_ALREADY_SET_OBJECT())
142 
143 #define GLOBUS_SEG_ERROR_INVALID_MODULE(module, errmsg) \
144  globus_error_put(GLOBUS_SEG_ERROR_INVALID_MODULE_OBJECT(module, errmsg))
145 
146 #define GLOBUS_SEG_ERROR_INVALID_FORMAT(fmt) \
147  globus_error_put(GLOBUS_SEG_ERROR_INVALID_FORMAT_OBJECT(fmt))
148 
149 #define GLOBUS_SEG_ERROR_OUT_OF_MEMORY \
150  globus_error_put(GLOBUS_SEG_ERROR_OUT_OF_MEMORY_OBJECT())
151 
152 #define GLOBUS_SEG_ERROR_LOADING_MODULE(module, dlerr_msg) \
153  globus_error_put(GLOBUS_SEG_ERROR_LOADING_MODULE_OBJECT(module, \
154  dlerr_msg))
155 
156 extern globus_module_descriptor_t globus_i_scheduler_event_generator_module;
157 #define GLOBUS_SCHEDULER_EVENT_GENERATOR_MODULE \
158  (&globus_i_scheduler_event_generator_module)
159 
181 globus_scheduler_event(
182  const char * format,
183  ...);
184 
186 globus_scheduler_event_pending(
187  time_t timestamp,
188  const char * jobid);
189 
191 globus_scheduler_event_active(
192  time_t timestamp,
193  const char * jobid);
194 
196 globus_scheduler_event_failed(
197  time_t timestamp,
198  const char * jobid,
199  int failure_code);
200 
202 globus_scheduler_event_done(
203  time_t timestamp,
204  const char * jobid,
205  int exit_code);
206 
208 globus_scheduler_event_generator_get_timestamp(
209  time_t * timestamp);
210 
211 #ifdef __cplusplus
212 }
213 #endif
214 
215 #endif /* GLOBUS_SCHEDULER_EVENT_GENERATOR_H */
Definition: globus_scheduler_event_generator.h:62
Definition: globus_scheduler_event_generator.h:54
Definition: globus_scheduler_event_generator.h:52
Definition: globus_scheduler_event_generator.h:56
Definition: globus_scheduler_event_generator.h:60
Headers common to all of Globus.
uint32_t globus_result_t
Definition: globus_types.h:99
globus_scheduler_event_generator_error_t
Definition: globus_scheduler_event_generator.h:49
Definition: globus_scheduler_event_generator.h:58
Module Descriptor.
Definition: globus_module.h:71