1
#ifndef __CL_LIST_TYPES_H
2
#define __CL_LIST_TYPES_H
4
/*___INFO__MARK_BEGIN__*/
5
/*************************************************************************
7
* The Contents of this file are made available subject to the terms of
8
* the Sun Industry Standards Source License Version 1.2
10
* Sun Microsystems Inc., March, 2001
13
* Sun Industry Standards Source License Version 1.2
14
* =================================================
15
* The contents of this file are subject to the Sun Industry Standards
16
* Source License Version 1.2 (the "License"); You may not use this file
17
* except in compliance with the License. You may obtain a copy of the
18
* License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
20
* Software provided under this License is provided on an "AS IS" basis,
21
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
22
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
23
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
24
* See the License for the specific provisions governing your rights and
25
* obligations concerning the Software.
27
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
29
* Copyright: 2001 by Sun Microsystems, Inc.
31
* All Rights Reserved.
33
************************************************************************/
34
/*___INFO__MARK_END__*/
39
#define CL_THREAD_LIST 1
41
typedef struct cl_thread_settings_type cl_thread_settings_t;
42
typedef struct cl_thread_condition_type cl_thread_condition_t;
43
/***********************************************************************/
45
/***********************************************************************/
46
typedef struct cl_raw_list_elem_type cl_raw_list_elem_t;
47
struct cl_raw_list_elem_type {
48
void* data; /* pointer to data */
49
cl_raw_list_elem_t* next;
50
cl_raw_list_elem_t* last;
54
typedef struct cl_raw_list_type {
55
char* list_name; /* name of list */
56
int list_type; /* type of list CL_THREAD_LIST, CL_LOG_LIST */
57
pthread_mutex_t* list_mutex; /* list lock mutex */
58
unsigned long elem_count; /* number of list entries */
59
void* list_data; /* user list data */
61
#ifdef CL_DO_COMMLIB_DEBUG
63
unsigned long lock_count;
64
unsigned long unlock_count;
66
cl_raw_list_elem_t* first_elem;
67
cl_raw_list_elem_t* last_elem;
70
/***********************************************************************/
73
/***********************************************************************/
75
/***********************************************************************/
76
typedef struct cl_thread_list_elem_type cl_thread_list_elem_t;
77
struct cl_thread_list_elem_type {
78
cl_thread_settings_t* thread_config; /* data */
79
cl_raw_list_elem_t* raw_elem;
85
/***********************************************************************/
87
typedef enum cl_log_type {
95
typedef enum cl_bool_def {
100
/***********************************************************************/
102
/***********************************************************************/
103
typedef struct cl_log_list_elem_type cl_log_list_elem_t;
104
struct cl_log_list_elem_type { /* list element specific data */
105
char* log_parameter; /* additional parameter */
106
char* log_message; /* log message */
107
char* log_thread_name; /* name of thread */
108
int log_thread_id; /* thread id */
109
int log_thread_state; /* state of thread */
110
cl_log_t log_type; /* log level type */
111
char* log_module_name; /* name of c - module */
112
cl_raw_list_elem_t* raw_elem;
115
typedef struct cl_application_error_list_elem_t {
116
cl_raw_list_elem_t* raw_elem; /* commlib internal list pointer to raw list element */
117
int cl_error; /* commlib error code
118
(use cl_get_error_text() to resolve error string) */
119
char* cl_info; /* additional error information */
120
struct timeval cl_log_time; /* time when the message was added */
121
cl_bool_t cl_already_logged;/* CL_TRUE when this error was logged the last
122
CL_DEFINE_MESSAGE_DUP_LOG_TIMEOUT seconds */
123
cl_log_t cl_err_type; /* commlib error message type */
124
} cl_application_error_list_elem_t;
126
typedef enum cl_log_list_flush_method_type {
127
CL_LOG_FLUSHED, /* flushing is done when ever user calls cl_log_list_flush() */
128
CL_LOG_IMMEDIATE /* cl_log_list_flush() is called on each log */
129
} cl_log_list_flush_method_t;
132
/* function return value function typedef func parameter */
133
typedef int (*cl_log_func_t) (cl_raw_list_t* log_list);
134
typedef unsigned long (*cl_app_status_func_t) (char** info_message);
135
typedef void (*cl_error_func_t) (const cl_application_error_list_elem_t* commlib_error);
136
typedef const char* (*cl_tag_name_func_t) (unsigned long tag);
137
typedef void (*cl_app_debug_client_func_t) (int cl_connected, int debug_level);
140
typedef struct cl_log_list_data_type { /* list specific data */
141
cl_log_t current_log_level; /* current log level */
142
cl_log_list_flush_method_t flush_type; /* flushing type */
143
cl_log_func_t flush_function; /* function called for flushing */
144
cl_thread_settings_t* list_creator_settings; /* log list creator thread settings */
145
} cl_log_list_data_t;
147
/***********************************************************************/
151
#endif /* __CL_LIST_TYPES_H */