From d19444904e3d0e0bcc4321f963993256619144fb Mon Sep 17 00:00:00 2001 From: Koichiro Iwao Date: Tue, 20 Aug 2024 10:50:33 +0900 Subject: [PATCH] newconfig: move some includes and macros to .c and make internal function static. --- xrdp/xrdp_newconfig.c | 7 ++++++- xrdp/xrdp_newconfig.h | 16 ++++------------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/xrdp/xrdp_newconfig.c b/xrdp/xrdp_newconfig.c index 6000ffd1b..b95368889 100644 --- a/xrdp/xrdp_newconfig.c +++ b/xrdp/xrdp_newconfig.c @@ -36,7 +36,12 @@ #include "os_calls.h" #include "parse.h" #include "toml.h" +#include "ms-rdpbcgr.h" #include "xrdp_newconfig.h" +#include "string_calls.h" + +#define GFX_CONF XRDP_CFG_PATH "/gfx.toml" +#define NCLOG(log_level, args...) LOG(log_level, "NewConfig: " args) #define X264_DEFAULT_PRESET "ultrafast" #define X264_DEFAULT_TUNE "zerolatency" @@ -44,7 +49,7 @@ #define X264_DEFAULT_FPS_NUM 24 #define X264_DEFAULT_FPS_DEN 1 -int +static int nc_load_gfx_x264_ct(toml_table_t *tfile, const int connection_type, struct xrdp_nc_gfx_x264_param *param) { diff --git a/xrdp/xrdp_newconfig.h b/xrdp/xrdp_newconfig.h index 6d794560c..0a8f14c4a 100644 --- a/xrdp/xrdp_newconfig.h +++ b/xrdp/xrdp_newconfig.h @@ -19,17 +19,12 @@ #ifndef _XRDP_NEWCONFIG_H_ #define _XRDP_NEWCONFIG_H_ -#include "toml.h" -#include "string_calls.h" -#include "ms-rdpbcgr.h" +struct toml_table_t; +typedef struct toml_table_t toml_table_t; -#if !defined(NUM_CONNECTION_TYPES) -#define NUM_CONNECTION_TYPES CONNECTION_TYPE_AUTODETECT -#endif - -#define GFX_CONF XRDP_CFG_PATH "/gfx.toml" +/* The number of connection types in MS-RDPBCGR 2.2.1.3.2 */ +#define NUM_CONNECTION_TYPES 7 -#define NCLOG(log_level, args...) LOG(log_level, "NewConfig: " args) /* nc stands for new config */ struct xrdp_nc_gfx_x264_param @@ -62,9 +57,6 @@ static const char *const rdpbcgr_connection_type_names[] = 0 }; - -int nc_load_gfx_x264_ct(toml_table_t *tfile, const int connection_type, - struct xrdp_nc_gfx_x264_param *param); int nc_load_gfx(const char *filename, struct xrdp_nc_gfx *config); #endif