Skip to content

Commit

Permalink
newconfig: move some includes and macros to .c
Browse files Browse the repository at this point in the history
and make internal function static.
  • Loading branch information
metalefty committed Aug 20, 2024
1 parent 73bdc5d commit d194449
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
7 changes: 6 additions & 1 deletion xrdp/xrdp_newconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,20 @@
#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"
#define X264_DEFAULT_PROFILE "main"
#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)
{
Expand Down
16 changes: 4 additions & 12 deletions xrdp/xrdp_newconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit d194449

Please sign in to comment.