Constify string arguments in xrdp-chansrv sources

This commit is contained in:
Pavel Roskin 2017-01-22 10:27:50 -08:00
parent 92d9f2e37e
commit e35b5a4708
6 changed files with 30 additions and 28 deletions

View File

@ -65,13 +65,13 @@ int xfuse_deinit(void) { return 0; }
int xfuse_check_wait_objs(void) { return 0; }
int xfuse_get_wait_objs(tbus *objs, int *count, int *timeout) { return 0; }
int xfuse_clear_clip_dir(void) { return 0; }
int xfuse_file_contents_range(int stream_id, char *data, int data_bytes) { return 0; }
int xfuse_file_contents_range(int stream_id, const char *data, int data_bytes) { return 0; }
int xfuse_file_contents_size(int stream_id, int file_size) { return 0; }
int xfuse_add_clip_dir_item(char *filename, int flags, int size, int lindex) { return 0; }
int xfuse_create_share(tui32 device_id, char *dirname) { return 0; }
int xfuse_add_clip_dir_item(const char *filename, int flags, int size, int lindex) { return 0; }
int xfuse_create_share(tui32 device_id, const char *dirname) { return 0; }
void xfuse_devredir_cb_open_file(void *vp, tui32 IoStatus, tui32 DeviceId, tui32 FileId) {}
void xfuse_devredir_cb_write_file(void *vp, char *buf, size_t length) {}
void xfuse_devredir_cb_read_file(void *vp, char *buf, size_t length) {}
void xfuse_devredir_cb_write_file(void *vp, const char *buf, size_t length) {}
void xfuse_devredir_cb_read_file(void *vp, const char *buf, size_t length) {}
int xfuse_devredir_cb_enum_dir(void *vp, struct xrdp_inode *xinode) { return 0; }
void xfuse_devredir_cb_enum_dir_done(void *vp, tui32 IoStatus) {}
void xfuse_devredir_cb_rmdir_or_file(void *vp, tui32 IoStatus) {}
@ -273,9 +273,9 @@ static void fuse_reverse_pathname(char *full_path, char *reverse_path);
static struct xrdp_inode * xfuse_get_inode_from_pinode_name(fuse_ino_t pinode,
const char *name);
static struct xrdp_inode * xfuse_create_file_in_xrdp_fs(tui32 device_id,
int pinode, char *name,
int type);
static struct xrdp_inode *
xfuse_create_file_in_xrdp_fs(tui32 device_id, int pinode, const char *name,
int type);
static int xfuse_does_file_exist(fuse_ino_t parent, char *name);
static int xfuse_delete_file_with_xinode(XRDP_INODE *xinode);
@ -596,7 +596,7 @@ int xfuse_get_wait_objs(tbus *objs, int *count, int *timeout)
* @return 0 on success, -1 on failure
*****************************************************************************/
int xfuse_create_share(tui32 device_id, char *dirname)
int xfuse_create_share(tui32 device_id, const char *dirname)
{
#if 0
XFUSE_INFO *fip;
@ -709,7 +709,8 @@ int xfuse_clear_clip_dir(void)
* @return 0 on success, -1 on failure
*****************************************************************************/
int xfuse_file_contents_range(int stream_id, char *data, int data_bytes)
int
xfuse_file_contents_range(int stream_id, const char *data, int data_bytes)
{
log_debug("entered: stream_id=%d data_bytes=%d", stream_id, data_bytes);
@ -756,7 +757,8 @@ int xfuse_file_contents_range(int stream_id, char *data, int data_bytes)
* @return 0 on success, -1 on failure
*****************************************************************************/
int xfuse_add_clip_dir_item(char *filename, int flags, int size, int lindex)
int
xfuse_add_clip_dir_item(const char *filename, int flags, int size, int lindex)
{
log_debug("entered: filename=%s flags=%d size=%d lindex=%d",
filename, flags, size, lindex);
@ -1204,9 +1206,9 @@ static struct xrdp_inode * xfuse_get_inode_from_pinode_name(fuse_ino_t pinode,
* @return XRDP_INODE on success, NULL on failure
*****************************************************************************/
static struct xrdp_inode * xfuse_create_file_in_xrdp_fs(tui32 device_id,
int pinode, char *name,
int type)
static struct xrdp_inode *
xfuse_create_file_in_xrdp_fs(tui32 device_id, int pinode, const char *name,
int type)
{
XRDP_INODE *xinode;
XRDP_INODE *xinodep;
@ -1681,7 +1683,7 @@ done:
free(fip);
}
void xfuse_devredir_cb_read_file(void *vp, char *buf, size_t length)
void xfuse_devredir_cb_read_file(void *vp, const char *buf, size_t length)
{
XFUSE_INFO *fip;
@ -1696,7 +1698,7 @@ void xfuse_devredir_cb_read_file(void *vp, char *buf, size_t length)
free(fip);
}
void xfuse_devredir_cb_write_file(void *vp, char *buf, size_t length)
void xfuse_devredir_cb_write_file(void *vp, const char *buf, size_t length)
{
XRDP_INODE *xinode;
XFUSE_INFO *fip;

View File

@ -49,18 +49,18 @@ int xfuse_init(void);
int xfuse_deinit(void);
int xfuse_check_wait_objs(void);
int xfuse_get_wait_objs(tbus *objs, int *count, int *timeout);
int xfuse_create_share(tui32 share_id, char *dirname);
int xfuse_create_share(tui32 share_id, const char *dirname);
int xfuse_clear_clip_dir(void);
int xfuse_file_contents_range(int stream_id, char *data, int data_bytes);
int xfuse_file_contents_range(int stream_id, const char *data, int data_bytes);
int xfuse_file_contents_size(int stream_id, int file_size);
int xfuse_add_clip_dir_item(char *filename, int flags, int size, int lindex);
int xfuse_add_clip_dir_item(const char *filename, int flags, int size, int lindex);
/* functions that are invoked from devredir */
int xfuse_devredir_cb_enum_dir(void *vp, struct xrdp_inode *xinode);
void xfuse_devredir_cb_enum_dir_done(void *vp, tui32 IoStatus);
void xfuse_devredir_cb_open_file(void *vp, tui32 IoStatus, tui32 DeviceId, tui32 FileId);
void xfuse_devredir_cb_read_file(void *vp, char *buf, size_t length);
void xfuse_devredir_cb_read_file(void *vp, const char *buf, size_t length);
void xfuse_devredir_cb_rmdir_or_file(void *vp, tui32 IoStatus);
void xfuse_devredir_cb_rename_file(void *vp, tui32 IoStatus);
void xfuse_devredir_cb_file_close(void *vp);

View File

@ -778,7 +778,7 @@ clipboard_send_format_announce(int xrdp_clip_type)
/*****************************************************************************/
static int APP_CC
clipboard_send_data_response_for_image(char* data, int data_size)
clipboard_send_data_response_for_image(const char *data, int data_size)
{
struct stream *s;
int size;
@ -802,7 +802,7 @@ clipboard_send_data_response_for_image(char* data, int data_size)
/*****************************************************************************/
static int APP_CC
clipboard_send_data_response_for_text(char* data, int data_size)
clipboard_send_data_response_for_text(const char *data, int data_size)
{
struct stream *s;
int size;
@ -845,7 +845,7 @@ clipboard_send_data_response_for_text(char* data, int data_size)
/*****************************************************************************/
static int APP_CC
clipboard_send_data_response(int xrdp_clip_type, char *data, int data_size)
clipboard_send_data_response(int xrdp_clip_type, const char *data, int data_size)
{
log_debug("clipboard_send_data_response:");
if (data != 0)

View File

@ -155,7 +155,7 @@ clipboard_check_file(char *filename)
/*****************************************************************************/
static int APP_CC
clipboard_get_file(char* file, int bytes)
clipboard_get_file(const char *file, int bytes)
{
int sindex;
int pindex;
@ -233,7 +233,7 @@ clipboard_get_file(char* file, int bytes)
/*****************************************************************************/
static int APP_CC
clipboard_get_files(char *files, int bytes)
clipboard_get_files(const char *files, int bytes)
{
int index;
int file_index;
@ -275,7 +275,7 @@ clipboard_get_files(char *files, int bytes)
/* server to client */
/* response to client asking for clipboard contents that is file list */
int APP_CC
clipboard_send_data_response_for_file(char *data, int data_size)
clipboard_send_data_response_for_file(const char *data, int data_size)
{
struct stream *s;
int size;

View File

@ -23,7 +23,7 @@
#include "parse.h"
int APP_CC
clipboard_send_data_response_for_file(char *data, int data_size);
clipboard_send_data_response_for_file(const char *data, int data_size);
int APP_CC
clipboard_process_file_request(struct stream *s, int clip_msg_status,
int clip_msg_len);

View File

@ -102,7 +102,7 @@ tui32 g_device_id; /* unique device ID - announced by client */
tui16 g_client_rdp_version; /* returned by client */
struct stream *g_input_stream = NULL;
void xfuse_devredir_cb_write_file(void *vp, char *buf, size_t length);
void xfuse_devredir_cb_write_file(void *vp, const char *buf, size_t length);
/*****************************************************************************/
int APP_CC