From 6816605e220023e7841406544c43bdbcac5de370 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 14 Feb 2024 19:45:59 +0100 Subject: [PATCH] os: move Auth* function types to separate header The generic auth handling isn't really OS specific, and only few sites actually need to call it, so at least it's prototypes are better off in some separate header. Signed-off-by: Enrico Weigelt, metux IT consult Part-of: --- os/auth.h | 29 +++++++++++++++++++++++++++++ os/mitauth.h | 2 +- os/osdep.h | 23 ----------------------- os/rpcauth.h | 2 +- os/xdmauth.h | 2 +- 5 files changed, 32 insertions(+), 26 deletions(-) create mode 100644 os/auth.h diff --git a/os/auth.h b/os/auth.h new file mode 100644 index 000000000..f632490d6 --- /dev/null +++ b/os/auth.h @@ -0,0 +1,29 @@ +#ifndef _XSERVER_OS_AUTH_H +#define _XSERVER_OS_AUTH_H + +#include + +#include "dix.h" + +#define AuthInitArgs void +typedef void (*AuthInitFunc) (AuthInitArgs); + +#define AuthAddCArgs unsigned short data_length, const char *data, XID id +typedef int (*AuthAddCFunc) (AuthAddCArgs); + +#define AuthCheckArgs unsigned short data_length, const char *data, ClientPtr client, const char **reason +typedef XID (*AuthCheckFunc) (AuthCheckArgs); + +#define AuthFromIDArgs XID id, unsigned short *data_lenp, char **datap +typedef int (*AuthFromIDFunc) (AuthFromIDArgs); + +#define AuthGenCArgs unsigned data_length, const char *data, XID id, unsigned *data_length_return, char **data_return +typedef XID (*AuthGenCFunc) (AuthGenCArgs); + +#define AuthRemCArgs unsigned short data_length, const char *data +typedef int (*AuthRemCFunc) (AuthRemCArgs); + +#define AuthRstCArgs void +typedef int (*AuthRstCFunc) (AuthRstCArgs); + +#endif /* _XSERVER_OS_AUTH_H */ diff --git a/os/mitauth.h b/os/mitauth.h index d67a58c95..143fa46bc 100644 --- a/os/mitauth.h +++ b/os/mitauth.h @@ -1,7 +1,7 @@ #ifndef _XSERVER_OS_MITAUTH_H #define _XSERVER_OS_MITAUTH_H -#include "osdep.h" +#include "auth.h" XID MitCheckCookie(AuthCheckArgs); XID MitGenerateCookie(AuthGenCArgs); diff --git a/os/osdep.h b/os/osdep.h index 19a7430d9..5b64f1a38 100644 --- a/os/osdep.h +++ b/os/osdep.h @@ -85,29 +85,6 @@ typedef struct _connectionOutput *ConnectionOutputPtr; struct _osComm; -#define AuthInitArgs void -typedef void (*AuthInitFunc) (AuthInitArgs); - -#define AuthAddCArgs unsigned short data_length, const char *data, XID id -typedef int (*AuthAddCFunc) (AuthAddCArgs); - -#define AuthCheckArgs unsigned short data_length, const char *data, ClientPtr client, const char **reason -typedef XID (*AuthCheckFunc) (AuthCheckArgs); - -#define AuthFromIDArgs XID id, unsigned short *data_lenp, char **datap -typedef int (*AuthFromIDFunc) (AuthFromIDArgs); - -#define AuthGenCArgs unsigned data_length, const char *data, XID id, unsigned *data_length_return, char **data_return -typedef XID (*AuthGenCFunc) (AuthGenCArgs); - -#define AuthRemCArgs unsigned short data_length, const char *data -typedef int (*AuthRemCFunc) (AuthRemCArgs); - -#define AuthRstCArgs void -typedef int (*AuthRstCFunc) (AuthRstCArgs); - -typedef void (*OsCloseFunc) (ClientPtr); - typedef int (*OsFlushFunc) (ClientPtr who, struct _osComm * oc, char *extraBuf, int extraCount); diff --git a/os/rpcauth.h b/os/rpcauth.h index 10fc33840..255eafcea 100644 --- a/os/rpcauth.h +++ b/os/rpcauth.h @@ -1,7 +1,7 @@ #ifndef _XSERVER_OS_RPCAUTH_H #define _XSERVER_OS_RPCAUTH_H -#include "osdep.h" +#include "auth.h" void SecureRPCInit(AuthInitArgs); XID SecureRPCCheck(AuthCheckArgs); diff --git a/os/xdmauth.h b/os/xdmauth.h index 7a42c8215..e922b2e99 100644 --- a/os/xdmauth.h +++ b/os/xdmauth.h @@ -1,7 +1,7 @@ #ifndef _XSERVER_OS_XDMAUTH_H #define _XSERVER_OS_XDMAUTH_H -#include "osdep.h" +#include "auth.h" XID XdmCheckCookie(AuthCheckArgs); int XdmAddCookie(AuthAddCArgs);