3
A brief file description
5
@section license License
7
Licensed to the Apache Software Foundation (ASF) under one
8
or more contributor license agreements. See the NOTICE file
9
distributed with this work for additional information
10
regarding copyright ownership. The ASF licenses this file
11
to you under the Apache License, Version 2.0 (the
12
"License"); you may not use this file except in compliance
13
with the License. You may obtain a copy of the License at
15
http://www.apache.org/licenses/LICENSE-2.0
17
Unless required by applicable law or agreed to in writing, software
18
distributed under the License is distributed on an "AS IS" BASIS,
19
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
See the License for the specific language governing permissions and
21
limitations under the License.
24
/***************************************************************************
26
* Purpose: defines the CallbackTable which stores callback functions for
30
***************************************************************************/
34
* defines the CallbackTable which stores callback functions for
35
* specific events. Used by both local api and remote api.
38
#ifndef _EVENT_CALLBACK_H_
39
#define _EVENT_CALLBACK_H_
41
#include "ink_llqueue.h"
43
#include "INKMgmtAPI.h"
44
#include "CoreAPIShared.h"
46
// when registering the callback function, can pass in void* data which
47
// will then be passed to the callback function; need to store this data with
48
// the callback in a struct
51
INKEventSignalFunc func;
55
// event_call_back_l is a queue of EventCallbackT
58
LLQ *event_callback_l[NUM_EVENTS];
59
ink_mutex event_callback_lock;
65
#endif /* __cplusplus */
67
EventCallbackT *create_event_callback(INKEventSignalFunc func, void *data);
68
void delete_event_callback(EventCallbackT * event_cb);
70
CallbackTable *create_callback_table(const char *lock_name);
72
void delete_callback_table(CallbackTable * cb_table);
74
// returns list of event_id that have at least one callback registered for it
75
LLQ *get_events_with_callbacks(CallbackTable * cb_table);
77
INKError cb_table_register(CallbackTable * cb_table, char *event_name, INKEventSignalFunc func, void *data,
79
INKError cb_table_unregister(CallbackTable * cb_table, char *event_name, INKEventSignalFunc func);
83
#endif /* __cplusplus */