os: move OsCommRec/Ptr and related functions into own header

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-11-07 16:42:29 +01:00
committed by Enrico Weigelt
parent 4af16f4ede
commit 2fe5e2519a
6 changed files with 35 additions and 25 deletions

View File

@@ -93,6 +93,7 @@ SOFTWARE.
#include <sys/types.h>
#include "dix/server_priv.h"
#include "os/io_priv.h"
#include "os/xhostname.h"
#ifndef WIN32

View File

@@ -97,6 +97,7 @@ SOFTWARE.
#include "os/audit_priv.h"
#include "os/auth.h"
#include "os/client_priv.h"
#include "os/io_priv.h"
#include "os/log_priv.h"
#include "os/osdep.h"
#include "os/probes_priv.h"
@@ -582,11 +583,7 @@ AllocNewConnection(XtransConnInfo trans_conn, int fd, CARD32 conn_time)
return NULL;
oc->trans_conn = trans_conn;
oc->fd = fd;
oc->input = (ConnectionInputPtr) NULL;
oc->output = (ConnectionOutputPtr) NULL;
oc->auth_id = None;
oc->conn_time = conn_time;
oc->flags = 0;
if (!(client = NextAvailableClient((void *) oc))) {
free(oc);
return NULL;

View File

@@ -75,6 +75,7 @@ SOFTWARE.
#include "dix/dix_priv.h"
#include "os/bug_priv.h"
#include "os/client_priv.h"
#include "os/io_priv.h"
#include "os/osdep.h"
#include "os/ossock.h"

31
os/io_priv.h Normal file
View File

@@ -0,0 +1,31 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#ifndef __XORG_OS_IO_H
#define __XORG_OS_IO_H
#include <X11/Xdefs.h>
#include "include/dix.h" /* ClientPtr */
struct _XtransConnInfo;
typedef struct _connectionInput *ConnectionInputPtr;
typedef struct _connectionOutput *ConnectionOutputPtr;
typedef struct {
int fd;
ConnectionInputPtr input;
ConnectionOutputPtr output;
XID auth_id;
CARD32 conn_time;
struct _XtransConnInfo *trans_conn;
int flags;
} OsCommRec, *OsCommPtr;
int FlushClient(ClientPtr who, OsCommPtr oc);
void FreeOsBuffers(OsCommPtr oc);
void CloseDownFileDescriptor(OsCommPtr oc);
#endif /* __XORG_OS_IO_H */

View File

@@ -70,27 +70,6 @@ SOFTWARE.
# define __has_builtin(x) 0 /* Compatibility with older compilers */
#endif
typedef struct _connectionInput *ConnectionInputPtr;
typedef struct _connectionOutput *ConnectionOutputPtr;
typedef struct _osComm {
int fd;
ConnectionInputPtr input;
ConnectionOutputPtr output;
XID auth_id; /* authorization id */
CARD32 conn_time; /* timestamp if not established, else 0 */
struct _XtransConnInfo *trans_conn; /* transport connection object */
int flags;
} OsCommRec, *OsCommPtr;
int FlushClient(ClientPtr who, OsCommPtr oc);
extern void FreeOsBuffers(OsCommPtr /*oc */
);
void
CloseDownFileDescriptor(OsCommPtr oc);
#define MILLI_PER_MIN (1000 * 60)
#define MILLI_PER_SECOND (1000)

View File

@@ -39,6 +39,7 @@ from The Open Group.
#include <X11/X.h>
#include "os/auth.h"
#include "os/io_priv.h"
#include "os/Xtrans.h"
#include "os.h"