Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/base64.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#ifdef PLATFORM_IS_ASCII
#define CHARMAP_BASE 0x28
#define E_IV E_INVALID /* For table alignment */
const unsigned char charmap[] =
static const unsigned char charmap[] =
{
/* 0x28 */ E_IV, E_IV, E_IV, 0x3e, E_IV, E_IV, E_IV, 0x3f,
/* 0x30 */ 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,
Expand Down
4 changes: 2 additions & 2 deletions common/scancode.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ enum settings_index
SI_BASE
};

const struct map_settings global_settings[] =
static const struct map_settings global_settings[] =
{
{
// SI_EVDEV
Expand All @@ -328,7 +328,7 @@ const struct map_settings global_settings[] =
};

// Default mapping set is "evdev"
const struct map_settings *settings = &global_settings[SI_EVDEV];
static const struct map_settings *settings = &global_settings[SI_EVDEV];

/*****************************************************************************/
int
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ AX_APPEND_COMPILE_FLAGS([-Wextra])
AX_APPEND_COMPILE_FLAGS([-Wno-missing-field-initializers])
AX_APPEND_COMPILE_FLAGS([-Wno-unused-parameter])
AX_APPEND_COMPILE_FLAGS([-Wno-sign-compare])
AX_APPEND_COMPILE_FLAGS([-Wmissing-variable-declarations], ,[-Werror])

AM_COND_IF([LINUX],
[AX_APPEND_COMPILE_FLAGS([-Werror])]) # bsd has warnings that have not been fixed yet
Expand Down
1 change: 1 addition & 0 deletions sesman/chansrv/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ xrdp_chansrv_SOURCES = \
sound.h \
xcommon.c \
xcommon.h \
xcommon_x11.h \
input.h \
audin.c \
audin.h
Expand Down
4 changes: 1 addition & 3 deletions sesman/chansrv/audin.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "xrdp_constants.h"
#include "fifo.h"
#include "audin.h"
#include "sound.h"

#define MSG_SNDIN_VERSION 1
#define MSG_SNDIN_FORMATS 2
Expand All @@ -47,9 +48,6 @@
#define AUDIN_NAME "AUDIO_INPUT"
#define AUDIN_FLAGS 1 /* WTS_CHANNEL_OPTION_DYNAMIC */

extern struct fifo *g_in_fifo; /* in sound.c */
extern int g_bytes_in_fifo; /* in sound.c */

struct xr_wave_format_ex
{
int wFormatTag;
Expand Down
2 changes: 1 addition & 1 deletion sesman/chansrv/chansrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ char *g_exec_name;
tbus g_exec_event = 0;
tbus g_exec_mutex;
tbus g_exec_sem;
int g_exec_pid = 0;
static int g_exec_pid = 0;

#define ARRAYSIZE(x) (sizeof(x)/sizeof(*(x)))
/* max total channel bytes size */
Expand Down
13 changes: 13 additions & 0 deletions sesman/chansrv/chansrv.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@
#include "parse.h"
#include "log.h"

extern struct config_chansrv *g_cfg;

extern int g_display_num;
extern int g_cliprdr_chan_id;
extern int g_rdpsnd_chan_id;
extern int g_rdpdr_chan_id;
extern int g_rail_chan_id;

extern char *g_exec_name;
extern tbus g_exec_event;
extern tbus g_exec_mutex;
extern tbus g_exec_sem;

struct chan_item
{
int id;
Expand Down
32 changes: 13 additions & 19 deletions sesman/chansrv/chansrv_fuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,16 @@
* limitations under the License.
*/

/* FUSE mount point */
char g_fuse_root_path[256] = "";
#ifdef XRDP_FUSE
static const char *g_fuse_root_path_basename; /* See xfuse_path_in_xfuse_fs() */
static int g_fuse_root_parent_dev; /* Ditto */
static int g_fuse_root_parent_ino; /* Ditto */
#endif
char g_fuse_clipboard_path[256] = ""; /* for clipboard use */

#if defined(HAVE_CONFIG_H)
#include <config_ac.h>
#endif
#include "arch.h"
#include "chansrv_fuse.h"
#include "chansrv_xfs.h"


// Globals needed regardless of the value of XRDP_FUSE
char g_fuse_clipboard_path[256] = ""; /* for clipboard use */

#ifndef XRDP_FUSE

Expand All @@ -41,10 +39,6 @@ char g_fuse_clipboard_path[256] = ""; /* for clipboard use */
#include <stdlib.h>
#include <string.h>

#include "arch.h"
#include "chansrv_fuse.h"
#include "chansrv_xfs.h"

/* dummy calls when XRDP_FUSE is not defined */
int xfuse_init(void)
{
Expand Down Expand Up @@ -162,18 +156,21 @@ int xfuse_path_in_xfuse_fs(const char *path)
#include <pthread.h>
#include <sched.h>

#include "arch.h"
#include "os_calls.h"
#include "string_calls.h"
#include "clipboard_file.h"
#include "chansrv_fuse.h"
#include "chansrv_xfs.h"
#include "chansrv.h"
#include "chansrv_config.h"
#include "devredir.h"
#include "list.h"
#include "file.h"

/* FUSE mount point */
static char g_fuse_root_path[256] = "";
static const char *g_fuse_root_path_basename; /* See xfuse_path_in_xfuse_fs() */
static int g_fuse_root_parent_dev; /* Ditto */
static int g_fuse_root_parent_ino; /* Ditto */

/* Check for FUSE features we may wish to use
*
* Note that FUSE_VERSION might be more useful for some features than
Expand All @@ -191,9 +188,6 @@ int xfuse_path_in_xfuse_fs(const char *path)
#define XFUSE_ENTRY_TIMEOUT 5.0


extern struct config_chansrv *g_cfg; /* in chansrv.c */


/* Local utility functions */

static inline char *
Expand Down
2 changes: 2 additions & 0 deletions sesman/chansrv/chansrv_fuse.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include "arch.h"
#include "ms-erref.h"

extern char g_fuse_clipboard_path[256];

/* Used to pass file info back to chansrv_fuse from devredir */
struct file_attr
{
Expand Down
8 changes: 0 additions & 8 deletions sesman/chansrv/clipboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,8 @@ x-special/gnome-copied-files
#define BMPFILEHEADER_LEN 14
#define BMPINFOHEADER_LEN 40

extern int g_cliprdr_chan_id; /* in chansrv.c */

extern Display *g_display; /* in xcommon.c */
extern int g_x_socket; /* in xcommon.c */
extern tbus g_x_wait_obj; /* in xcommon.c */
extern Screen *g_screen; /* in xcommon.c */
extern int g_screen_num; /* in xcommon.c */

extern struct config_chansrv *g_cfg; /* in chansrv.c */

int g_clip_up = 0;

static Atom g_clipboard_atom = 0; /* CLIPBOARD */
Expand Down
5 changes: 5 additions & 0 deletions sesman/chansrv/clipboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
#include "arch.h"
#include "parse.h"

extern int g_clip_up;

extern struct clip_s2c g_clip_s2c;
extern struct clip_c2s g_clip_c2s;

int clipboard_init(void);
int clipboard_deinit(void);
int clipboard_data_in(struct stream *s, int chan_id, int chan_flags, int length, int total_length);
Expand Down
7 changes: 0 additions & 7 deletions sesman/chansrv/clipboard_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@
#include "chansrv_fuse.h"
#include "ms-rdpeclip.h"

extern int g_cliprdr_chan_id; /* in chansrv.c */

extern struct clip_s2c g_clip_s2c; /* in clipboard.c */
extern struct clip_c2s g_clip_c2s; /* in clipboard.c */

extern char g_fuse_clipboard_path[];

struct cb_file_info
{
char *pathname;
Expand Down
11 changes: 4 additions & 7 deletions sesman/chansrv/devredir.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ enum COMPLETION_TYPE
};


/* globals */
extern int g_rdpdr_chan_id; /* in chansrv.c */

/* Capabilities from GENERAL_CAPS_SET in Client Core Capability Response */
struct client_caps
{
Expand All @@ -118,10 +115,10 @@ static struct client_caps g_ccap;

tui32 g_completion_id = 1;

tui32 g_clientID; /* unique client ID - announced by client */
tui32 g_device_id; /* unique device ID - announced by client */
tui16 g_client_rdp_version; /* returned by client */
struct stream *g_input_stream = NULL;
static tui32 g_clientID; /* unique client ID - announced by client */
static tui32 g_device_id; /* unique device ID - announced by client */
static tui16 g_client_rdp_version; /* returned by client */
static struct stream *g_input_stream = NULL;

/*
* Local functions called from devredir_proc_device_iocompletion()
Expand Down
2 changes: 2 additions & 0 deletions sesman/chansrv/devredir.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "irp.h"
#include "ms-rdpefs.h"

extern tui32 g_completion_id;

int devredir_init(void);
int devredir_deinit(void);

Expand Down
2 changes: 1 addition & 1 deletion sesman/chansrv/irp.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "string_calls.h"
#include "irp.h"

IRP *g_irp_head = NULL;
static IRP *g_irp_head = NULL;

/**
* Create a new IRP and append to linked list
Expand Down
17 changes: 1 addition & 16 deletions sesman/chansrv/rail.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,13 @@
#include "chansrv.h"
#include "rail.h"
#include "xcommon.h"
#include "xcommon_x11.h"
#include "log.h"
#include "os_calls.h"
#include "string_calls.h"
#include "thread_calls.h"
#include "list.h"

extern int g_rail_chan_id; /* in chansrv.c */
extern int g_display_num; /* in chansrv.c */
extern char *g_exec_name; /* in chansrv.c */
extern tbus g_exec_event; /* in chansrv.c */
extern tbus g_exec_mutex; /* in chansrv.c */
extern tbus g_exec_sem; /* in chansrv.c */

extern Display *g_display; /* in xcommon.c */
extern Screen *g_screen; /* in xcommon.c */
extern Window g_root_window; /* in xcommon.c */
extern Atom g_wm_delete_window_atom; /* in xcommon.c */
extern Atom g_wm_protocols_atom; /* in xcommon.c */
extern Atom g_utf8_string; /* in xcommon.c */
extern Atom g_net_wm_name; /* in xcommon.c */
extern Atom g_wm_state; /* in xcommon.c */

static Atom g_rwd_atom = 0;

int g_rail_up = 0;
Expand Down
2 changes: 2 additions & 0 deletions sesman/chansrv/rail.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include "arch.h"
#include "parse.h"

extern int g_rail_up;

int
rail_init(void);
int
Expand Down
8 changes: 2 additions & 6 deletions sesman/chansrv/smartcard.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,11 @@ typedef struct smartcard
} SMARTCARD;

/* globals */
SMARTCARD *smartcards[MAX_SMARTCARDS];
int g_smartcards_inited = 0;
static SMARTCARD *smartcards[MAX_SMARTCARDS];
static int g_smartcards_inited = 0;
static tui32 g_device_id = 0;
static int g_scard_index = 0;

/* externs */
extern tui32 g_completion_id;
extern int g_rdpdr_chan_id; /* in chansrv.c */


/******************************************************************************
** static functions local to this file **
Expand Down
2 changes: 0 additions & 2 deletions sesman/chansrv/smartcard_pcsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
#if PCSC_STANDIN


extern int g_display_num; /* in chansrv.c */

static int g_autoinc = 0; /* general purpose autoinc */

struct pcsc_card /* item for list of open cards in one context */
Expand Down
4 changes: 0 additions & 4 deletions sesman/chansrv/sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ static OpusEncoder *g_opus_encoder = 0;
static lame_global_flags *g_lame_encoder = 0;
#endif

extern int g_rdpsnd_chan_id; /* in chansrv.c */
extern int g_display_num; /* in chansrv.c */
extern struct config_chansrv *g_cfg; /* in chansrv.c */

/* audio out: sound_server -> xrdp -> NeutrinoRDP */
static struct trans *g_audio_l_trans_out = 0; /* listener */
static struct trans *g_audio_c_trans_out = 0; /* connection */
Expand Down
3 changes: 3 additions & 0 deletions sesman/chansrv/sound.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
#include "chansrv.h"
#include "trans.h"

extern struct fifo *g_in_fifo;
extern int g_bytes_in_fifo;

#define SNDC_CLOSE 0x01
#define SNDC_WAVE 0x02
#define SNDC_SETVOLUME 0x03
Expand Down
14 changes: 7 additions & 7 deletions sesman/chansrv/xcommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@
#include "clipboard.h"
#include "rail.h"
#include "xcommon.h"
#include "xcommon_x11.h"

extern int g_clip_up; /* in clipboard.c */

extern int g_rail_up; /* in rail.c */

/* globals declared in xcommon_x11.h */
Display *g_display = 0;
int g_x_socket = 0;
tbus g_x_wait_obj = 0;
Screen *g_screen = 0;
int g_screen_num = 0;
Window g_root_window = 0;
Atom g_wm_delete_window_atom = 0;
Atom g_wm_protocols_atom = 0;
Atom g_utf8_string = 0;
Atom g_net_wm_name = 0;
Atom g_wm_state = 0;

/* globals declared in xcommon.h */
int g_x_socket = 0;
tbus g_x_wait_obj = 0;
Window g_root_window = 0;

static x_server_fatal_cb_type x_server_fatal_handler = 0;


Expand Down
9 changes: 9 additions & 0 deletions sesman/chansrv/xcommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@

typedef void (*x_server_fatal_cb_type)(void);

/*
* Global variables defined in xcommon.c
*
* For globals with X11-specific types, see xcommon_x11.h
*/
extern int g_x_socket;
extern tbus g_x_wait_obj;
extern int g_screen_num;

int
xcommon_init(void);
int
Expand Down
Loading