diff --git a/os/access.c b/os/access.c index 1a90600107..f6a61089fb 100644 --- a/os/access.c +++ b/os/access.c @@ -93,6 +93,7 @@ SOFTWARE. #include #include "dix/server_priv.h" +#include "os/io_priv.h" #include "os/xhostname.h" #ifndef WIN32 diff --git a/os/connection.c b/os/connection.c index 98934e5856..f50dcd574b 100644 --- a/os/connection.c +++ b/os/connection.c @@ -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; diff --git a/os/io.c b/os/io.c index d6be03f1e3..485c9b5715 100644 --- a/os/io.c +++ b/os/io.c @@ -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" diff --git a/os/io_priv.h b/os/io_priv.h new file mode 100644 index 0000000000..255c31394a --- /dev/null +++ b/os/io_priv.h @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: MIT OR X11 + * + * Copyright © 2024 Enrico Weigelt, metux IT consult + */ +#ifndef __XORG_OS_IO_H +#define __XORG_OS_IO_H + +#include + +#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 */ diff --git a/os/osdep.h b/os/osdep.h index 5f974f2447..2117d81eb9 100644 --- a/os/osdep.h +++ b/os/osdep.h @@ -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) diff --git a/os/xdmauth.c b/os/xdmauth.c index 1ed48e3da4..11e8df9b51 100644 --- a/os/xdmauth.c +++ b/os/xdmauth.c @@ -39,6 +39,7 @@ from The Open Group. #include #include "os/auth.h" +#include "os/io_priv.h" #include "os/Xtrans.h" #include "os.h"