Loading...
Searching...
No Matches
globus_scheduler_event_generator.h
/*
* Copyright 1999-2014 University of Chicago
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef GLOBUS_SCHEDULER_EVENT_GENERATOR_H
#define GLOBUS_SCHEDULER_EVENT_GENERATOR_H
#include "globus_common.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef GLOBUS_GLOBAL_DOCUMENT_SET
#endif
typedef enum
{
GLOBUS_SEG_ERROR_TYPE_NULL = 1024,
GLOBUS_SEG_ERROR_TYPE_ALREADY_SET,
GLOBUS_SEG_ERROR_TYPE_INVALID_MODULE,
GLOBUS_SEG_ERROR_TYPE_INVALID_FORMAT,
GLOBUS_SEG_ERROR_TYPE_OUT_OF_MEMORY,
GLOBUS_SEG_ERROR_TYPE_LOADING_MODULE
}
globus_scheduler_event_generator_error_t;
#if __STDC_VERSION__ == 199901L
# define MYNAME __func__
#elif defined(__GNUC__)
# define MYNAME __FUNCTION__
#else
# define MYNAME ""
#endif
typedef void (*globus_scheduler_event_generator_fault_t)(
void * user_arg,
globus_result_t fault);
#define GLOBUS_SEG_ERROR_NULL_OBJECT() \
globus_error_construct_error(GLOBUS_SCHEDULER_EVENT_GENERATOR_MODULE, \
NULL, \
GLOBUS_SEG_ERROR_TYPE_NULL, \
__FILE__, \
MYNAME, \
__LINE__, \
"Null parameter")
#define GLOBUS_SEG_ERROR_ALREADY_SET_OBJECT() \
globus_error_construct_error(GLOBUS_SCHEDULER_EVENT_GENERATOR_MODULE, \
NULL, \
GLOBUS_SEG_ERROR_TYPE_ALREADY_SET, \
__FILE__, \
MYNAME, \
__LINE__, \
"Value already set")
#define GLOBUS_SEG_ERROR_INVALID_MODULE_OBJECT(module, errmsg) \
globus_error_construct_error(GLOBUS_SCHEDULER_EVENT_GENERATOR_MODULE, \
NULL, \
GLOBUS_SEG_ERROR_TYPE_INVALID_MODULE, \
__FILE__, \
MYNAME, \
__LINE__, \
"Invalid module %s: %s", \
module, \
errmsg)
#define GLOBUS_SEG_ERROR_INVALID_FORMAT_OBJECT(fmt) \
globus_error_construct_error(GLOBUS_SCHEDULER_EVENT_GENERATOR_MODULE, \
NULL, \
GLOBUS_SEG_ERROR_TYPE_INVALID_FORMAT, \
__FILE__, \
MYNAME, \
__LINE__, \
"Invalid format %s", \
fmt)
#define GLOBUS_SEG_ERROR_OUT_OF_MEMORY_OBJECT() \
globus_error_construct_error(GLOBUS_SCHEDULER_EVENT_GENERATOR_MODULE, \
NULL, \
GLOBUS_SEG_ERROR_TYPE_OUT_OF_MEMORY, \
__FILE__, \
MYNAME, \
__LINE__, \
"Out of memory")
#define GLOBUS_SEG_ERROR_LOADING_MODULE_OBJECT(module, dlerr_msg) \
globus_error_construct_error(GLOBUS_SCHEDULER_EVENT_GENERATOR_MODULE, \
NULL, \
GLOBUS_SEG_ERROR_TYPE_LOADING_MODULE, \
__FILE__, \
MYNAME, \
__LINE__, \
"Unable to dlopen module \"%s\": %s", \
module, \
dlerr_msg)
#define GLOBUS_SEG_ERROR_NULL \
globus_error_put(GLOBUS_SEG_ERROR_NULL_OBJECT())
#define GLOBUS_SEG_ERROR_ALREADY_SET \
globus_error_put(GLOBUS_SEG_ERROR_ALREADY_SET_OBJECT())
#define GLOBUS_SEG_ERROR_INVALID_MODULE(module, errmsg) \
globus_error_put(GLOBUS_SEG_ERROR_INVALID_MODULE_OBJECT(module, errmsg))
#define GLOBUS_SEG_ERROR_INVALID_FORMAT(fmt) \
globus_error_put(GLOBUS_SEG_ERROR_INVALID_FORMAT_OBJECT(fmt))
#define GLOBUS_SEG_ERROR_OUT_OF_MEMORY \
globus_error_put(GLOBUS_SEG_ERROR_OUT_OF_MEMORY_OBJECT())
#define GLOBUS_SEG_ERROR_LOADING_MODULE(module, dlerr_msg) \
globus_error_put(GLOBUS_SEG_ERROR_LOADING_MODULE_OBJECT(module, \
dlerr_msg))
extern globus_module_descriptor_t globus_i_scheduler_event_generator_module;
#define GLOBUS_SCHEDULER_EVENT_GENERATOR_MODULE \
(&globus_i_scheduler_event_generator_module)
globus_result_t
globus_scheduler_event(
const char * format,
...);
globus_result_t
globus_scheduler_event_pending(
time_t timestamp,
const char * jobid);
globus_result_t
globus_scheduler_event_active(
time_t timestamp,
const char * jobid);
globus_result_t
globus_scheduler_event_failed(
time_t timestamp,
const char * jobid,
int failure_code);
globus_result_t
globus_scheduler_event_done(
time_t timestamp,
const char * jobid,
int exit_code);
globus_result_t
globus_scheduler_event_generator_get_timestamp(
time_t * timestamp);
#ifdef __cplusplus
}
#endif
#endif /* GLOBUS_SCHEDULER_EVENT_GENERATOR_H */
globus_scheduler_event_generator_error_t
globus_scheduler_event_generator_error_t
Definition globus_scheduler_event_generator.h:50
GLOBUS_SEG_ERROR_TYPE_INVALID_MODULE
@ GLOBUS_SEG_ERROR_TYPE_INVALID_MODULE
Definition globus_scheduler_event_generator.h:56
GLOBUS_SEG_ERROR_TYPE_OUT_OF_MEMORY
@ GLOBUS_SEG_ERROR_TYPE_OUT_OF_MEMORY
Definition globus_scheduler_event_generator.h:60
GLOBUS_SEG_ERROR_TYPE_ALREADY_SET
@ GLOBUS_SEG_ERROR_TYPE_ALREADY_SET
Definition globus_scheduler_event_generator.h:54
GLOBUS_SEG_ERROR_TYPE_LOADING_MODULE
@ GLOBUS_SEG_ERROR_TYPE_LOADING_MODULE
Definition globus_scheduler_event_generator.h:62
GLOBUS_SEG_ERROR_TYPE_INVALID_FORMAT
@ GLOBUS_SEG_ERROR_TYPE_INVALID_FORMAT
Definition globus_scheduler_event_generator.h:58
GLOBUS_SEG_ERROR_TYPE_NULL
@ GLOBUS_SEG_ERROR_TYPE_NULL
Definition globus_scheduler_event_generator.h:52