2024-02-29 18:44:33 +01:00
|
|
|
/* SPDX-License-Identifier: MIT OR X11
|
|
|
|
|
*
|
|
|
|
|
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
|
|
|
|
|
*/
|
|
|
|
|
#ifndef _XSERVER_CALLBACK_PRIV_H
|
|
|
|
|
#define _XSERVER_CALLBACK_PRIV_H
|
|
|
|
|
|
|
|
|
|
#include "callback.h"
|
|
|
|
|
|
|
|
|
|
void InitCallbackManager(void);
|
|
|
|
|
void DeleteCallbackManager(void);
|
|
|
|
|
|
2025-11-01 22:13:25 +02:00
|
|
|
typedef struct _CallbackRec {
|
|
|
|
|
CallbackProcPtr proc;
|
|
|
|
|
void *data;
|
|
|
|
|
Bool deleted;
|
|
|
|
|
struct _CallbackRec *next;
|
|
|
|
|
} CallbackRec, *CallbackPtr;
|
|
|
|
|
|
|
|
|
|
typedef struct _CallbackList {
|
|
|
|
|
int inCallback;
|
|
|
|
|
Bool deleted;
|
|
|
|
|
int numDeleted;
|
|
|
|
|
CallbackPtr list;
|
|
|
|
|
} CallbackListRec;
|
|
|
|
|
|
2025-04-23 19:59:06 +02:00
|
|
|
/*
|
|
|
|
|
* @brief delete a callback list
|
|
|
|
|
*
|
|
|
|
|
* Calling this is necessary if a CallbackListPtr is used inside a dynamically
|
|
|
|
|
* allocated structure, before it is freed. If it's not done, memory corruption
|
|
|
|
|
* or segfault can happen at a much later point (eg. next server incarnation)
|
|
|
|
|
*
|
|
|
|
|
* @param pcbl pointer to the list head (CallbackListPtr)
|
|
|
|
|
*/
|
|
|
|
|
void DeleteCallbackList(CallbackListPtr *pcbl);
|
|
|
|
|
|
2024-02-29 18:44:33 +01:00
|
|
|
#endif /* _XSERVER_CALLBACK_PRIV_H */
|