Grid Community Toolkit  6.2.1629922860 (tag: v6.2.20210826)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
globus_scheduler_event_generator_app.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 #ifndef GLOBUS_SCHEDULER_EVENT_GENERATOR_APP_H
17 #define GLOBUS_SCHEDULER_EVENT_GENERATOR_APP_H 1
18 
19 #include "globus_common.h"
20 #include "globus_gram_protocol.h"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 typedef enum
27 {
28  GLOBUS_SCHEDULER_EVENT_PENDING = GLOBUS_GRAM_PROTOCOL_JOB_STATE_PENDING,
29  GLOBUS_SCHEDULER_EVENT_ACTIVE = GLOBUS_GRAM_PROTOCOL_JOB_STATE_ACTIVE,
30  GLOBUS_SCHEDULER_EVENT_FAILED = GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED,
31  GLOBUS_SCHEDULER_EVENT_DONE = GLOBUS_GRAM_PROTOCOL_JOB_STATE_DONE,
32  GLOBUS_SCHEDULER_EVENT_RAW
33 }
34 globus_scheduler_event_type_t;
35 
36 typedef struct
37 {
38  globus_scheduler_event_type_t event_type;
39  char * job_id;
40  time_t timestamp;
41  /* only set if DONE */
42  int exit_code;
43  /* only set if FAILED */
44  int failure_code;
45  /* only set if RAW */
46  char * raw_event;
47 }
48 globus_scheduler_event_t;
49 
50 typedef globus_result_t (*globus_scheduler_event_generator_event_handler_t)(
51  void * user_arg,
52  const globus_scheduler_event_t * event);
53 
54 /* API used by executable which drives the SEG */
56 globus_scheduler_event_generator_set_timestamp(
57  time_t timestamp);
58 
60 globus_scheduler_event_generator_load_module(
61  const char * module_name);
62 
63 typedef void (*globus_scheduler_event_generator_fault_handler_t)(
64  void * user_arg,
65  globus_result_t result);
66 
68 globus_scheduler_event_generator_set_fault_handler(
69  globus_scheduler_event_generator_fault_handler_t
70  fault_handler,
71  void * user_arg);
72 
74 globus_scheduler_event_generator_set_event_handler(
75  globus_scheduler_event_generator_event_handler_t
76  event_handler,
77  void * user_arg);
78 
79 void
80 globus_scheduler_event_generator_fault(
81  globus_result_t result);
82 
84 globus_scheduler_event_copy(
85  globus_scheduler_event_t ** copy,
86  const globus_scheduler_event_t * event);
87 
88 void
89 globus_scheduler_event_destroy(
90  globus_scheduler_event_t * event);
91 
92 
93 #ifdef __cplusplus
94 }
95 #endif
96 
97 #endif /* GLOBUS_SCHEDULER_EVENT_GENERATOR_APP_H */
Definition: globus_gram_protocol_constants.h:273
Definition: globus_gram_protocol_constants.h:275
Headers common to all of Globus.
uint32_t globus_result_t
Definition: globus_types.h:99
Definition: globus_gram_protocol_constants.h:277
GRAM Protocol API.
Definition: globus_gram_protocol_constants.h:280