os: move X_NOTIFY_* defines to separate header

These defines are already public, used by consumers of SetNotifyFd(),
but also needed in places where os.h cannot be included.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-07-25 14:35:33 +02:00
parent 8a8c29165a
commit 23aa722c15
4 changed files with 18 additions and 4 deletions

15
include/fd_notify.h Normal file
View File

@@ -0,0 +1,15 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*
* @brief: defines needed for SetNotifyFd() as well as ospoll
*/
#ifndef _XSERVER_INCLUDE_FDNOTIFY_H
#define _XSERVER_INCLUDE_FDNOTIFY_H
#define X_NOTIFY_NONE 0x0
#define X_NOTIFY_READ 0x1
#define X_NOTIFY_WRITE 0x2
#define X_NOTIFY_ERROR 0x4 /* don't need to select for, always reported */
#endif /* _XSERVER_INCLUDE_FDNOTIFY_H */

View File

@@ -446,6 +446,7 @@ if build_xorg
'extension.h',
'extinit.h',
'extnsionst.h',
'fd_notify.h',
'fourcc.h',
'gc.h',
'gcstruct.h',

View File

@@ -98,10 +98,7 @@ extern _X_EXPORT int WriteToClient(ClientPtr /*who */ , int /*count */ ,
typedef void (*NotifyFdProcPtr)(int fd, int ready, void *data);
#define X_NOTIFY_NONE 0x0
#define X_NOTIFY_READ 0x1
#define X_NOTIFY_WRITE 0x2
#define X_NOTIFY_ERROR 0x4 /* don't need to select for, always reported */
#include "fd_notify.h"
extern _X_EXPORT Bool SetNotifyFd(int fd, NotifyFdProcPtr notify_fd, int mask, void *data);