FreeRDP
posix.c File Reference
#include <stddef.h>
#include <stdlib.h>
#include <errno.h>
#include <dirent.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <winpr/crt.h>
#include <winpr/clipboard.h>
#include <winpr/collections.h>
#include <winpr/file.h>
#include <winpr/shell.h>
#include <winpr/string.h>
#include <winpr/wlog.h>
#include "clipboard.h"
#include "posix.h"
#include "../log.h"

Macros

#define _FILE_OFFSET_BITS   64
 
#define TAG   WINPR_TAG("clipboard.posix")
 

Functions

static struct posix_file * make_posix_file (const char *local_name, const WCHAR *remote_name)
 
static void free_posix_file (void *the_file)
 
static unsigned char hex_to_dec (char c, BOOL *valid)
 
static BOOL decode_percent_encoded_byte (const char *str, const char *end, char *value)
 
static char * decode_percent_encoded_string (const char *str, size_t len)
 
static WCHAR * convert_local_name_component_to_remote (const char *local_name)
 
static char * concat_local_name (const char *dir, const char *file)
 
static WCHAR * concat_remote_name (const WCHAR *dir, const WCHAR *file)
 
static BOOL add_file_to_list (const char *local_name, const WCHAR *remote_name, wArrayList *files)
 
static BOOL add_directory_entry_to_list (const char *local_dir_name, const WCHAR *remote_dir_name, const struct dirent *entry, wArrayList *files)
 
static BOOL do_add_directory_contents_to_list (const char *local_name, const WCHAR *remote_name, DIR *dirp, wArrayList *files)
 
static BOOL add_directory_contents_to_list (const char *local_name, const WCHAR *remote_name, wArrayList *files)
 
static const char * get_basename (const char *name)
 
static BOOL process_file_name (const char *local_name, wArrayList *files)
 
static BOOL process_uri (const char *uri, size_t uri_len, wArrayList *files)
 
static BOOL process_uri_list (const char *data, size_t length, wArrayList *files)
 
static BOOL convert_local_file_to_filedescriptor (const struct posix_file *file, FILEDESCRIPTOR *descriptor)
 
static FILEDESCRIPTOR * convert_local_file_list_to_filedescriptors (wArrayList *files)
 
static voidconvert_uri_list_to_filedescriptors (wClipboard *clipboard, UINT32 formatId, const void *data, UINT32 *pSize)
 
static BOOL register_file_formats_and_synthesizers (wClipboard *clipboard)
 
static UINT posix_file_get_size (const struct posix_file *file, INT64 *size)
 
static UINT posix_file_request_size (wClipboardDelegate *delegate, const wClipboardFileSizeRequest *request)
 
static UINT posix_file_read_open (struct posix_file *file)
 
static UINT posix_file_read_seek (struct posix_file *file, UINT64 offset)
 
static UINT posix_file_read_perform (struct posix_file *file, UINT32 size, BYTE **actual_data, UINT32 *actual_size)
 
static UINT posix_file_read_close (struct posix_file *file)
 
static UINT posix_file_get_range (struct posix_file *file, UINT64 offset, UINT32 size, BYTE **actual_data, UINT32 *actual_size)
 
static UINT posix_file_request_range (wClipboardDelegate *delegate, const wClipboardFileRangeRequest *request)
 
static UINT dummy_file_size_success (wClipboardDelegate *delegate, const wClipboardFileSizeRequest *request, UINT64 fileSize)
 
static UINT dummy_file_size_failure (wClipboardDelegate *delegate, const wClipboardFileSizeRequest *request, UINT errorCode)
 
static UINT dummy_file_range_success (wClipboardDelegate *delegate, const wClipboardFileRangeRequest *request, const BYTE *data, UINT32 size)
 
static UINT dummy_file_range_failure (wClipboardDelegate *delegate, const wClipboardFileRangeRequest *request, UINT errorCode)
 
static void setup_delegate (wClipboardDelegate *delegate)
 
BOOL ClipboardInitPosixFileSubsystem (wClipboard *clipboard)
 

Macro Definition Documentation

#define _FILE_OFFSET_BITS   64

WinPR: Windows Portable Runtime Clipboard Functions: POSIX file handling

Copyright 2017 Alexei Lozovsky a.loz.nosp@m.ovsk.nosp@m.y@gma.nosp@m.il.c.nosp@m.om

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

#define TAG   WINPR_TAG("clipboard.posix")

Function Documentation

static BOOL add_directory_contents_to_list ( const char *  local_name,
const WCHAR *  remote_name,
wArrayList *  files 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL add_directory_entry_to_list ( const char *  local_dir_name,
const WCHAR *  remote_dir_name,
const struct dirent *  entry,
wArrayList *  files 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL add_file_to_list ( const char *  local_name,
const WCHAR *  remote_name,
wArrayList *  files 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL ClipboardInitPosixFileSubsystem ( wClipboard *  clipboard)

WinPR: Windows Portable Runtime Clipboard Functions: POSIX file handling

Copyright 2017 Alexei Lozovsky a.loz.nosp@m.ovsk.nosp@m.y@gma.nosp@m.il.c.nosp@m.om

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Here is the call graph for this function:

Here is the caller graph for this function:

static char* concat_local_name ( const char *  dir,
const char *  file 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static WCHAR* concat_remote_name ( const WCHAR *  dir,
const WCHAR *  file 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static FILEDESCRIPTOR* convert_local_file_list_to_filedescriptors ( wArrayList *  files)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL convert_local_file_to_filedescriptor ( const struct posix_file *  file,
FILEDESCRIPTOR *  descriptor 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static WCHAR* convert_local_name_component_to_remote ( const char *  local_name)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void* convert_uri_list_to_filedescriptors ( wClipboard *  clipboard,
UINT32  formatId,
const void data,
UINT32 pSize 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL decode_percent_encoded_byte ( const char *  str,
const char *  end,
char *  value 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static char* decode_percent_encoded_string ( const char *  str,
size_t  len 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL do_add_directory_contents_to_list ( const char *  local_name,
const WCHAR *  remote_name,
DIR *  dirp,
wArrayList *  files 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT dummy_file_range_failure ( wClipboardDelegate *  delegate,
const wClipboardFileRangeRequest *  request,
UINT  errorCode 
)
static

Here is the caller graph for this function:

static UINT dummy_file_range_success ( wClipboardDelegate *  delegate,
const wClipboardFileRangeRequest *  request,
const BYTE data,
UINT32  size 
)
static

Here is the caller graph for this function:

static UINT dummy_file_size_failure ( wClipboardDelegate *  delegate,
const wClipboardFileSizeRequest *  request,
UINT  errorCode 
)
static

Here is the caller graph for this function:

static UINT dummy_file_size_success ( wClipboardDelegate *  delegate,
const wClipboardFileSizeRequest *  request,
UINT64  fileSize 
)
static

Here is the caller graph for this function:

static void free_posix_file ( void the_file)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static const char* get_basename ( const char *  name)
static

Here is the caller graph for this function:

static unsigned char hex_to_dec ( char  c,
BOOL *  valid 
)
static

Here is the caller graph for this function:

static struct posix_file* make_posix_file ( const char *  local_name,
const WCHAR *  remote_name 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT posix_file_get_range ( struct posix_file *  file,
UINT64  offset,
UINT32  size,
BYTE **  actual_data,
UINT32 actual_size 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT posix_file_get_size ( const struct posix_file *  file,
INT64 *  size 
)
static

Here is the caller graph for this function:

static UINT posix_file_read_close ( struct posix_file *  file)
static

Here is the caller graph for this function:

static UINT posix_file_read_open ( struct posix_file *  file)
static

Here is the caller graph for this function:

static UINT posix_file_read_perform ( struct posix_file *  file,
UINT32  size,
BYTE **  actual_data,
UINT32 actual_size 
)
static

Here is the caller graph for this function:

static UINT posix_file_read_seek ( struct posix_file *  file,
UINT64  offset 
)
static

Here is the caller graph for this function:

static UINT posix_file_request_range ( wClipboardDelegate *  delegate,
const wClipboardFileRangeRequest *  request 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT posix_file_request_size ( wClipboardDelegate *  delegate,
const wClipboardFileSizeRequest *  request 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL process_file_name ( const char *  local_name,
wArrayList *  files 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL process_uri ( const char *  uri,
size_t  uri_len,
wArrayList *  files 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL process_uri_list ( const char *  data,
size_t  length,
wArrayList *  files 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL register_file_formats_and_synthesizers ( wClipboard *  clipboard)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void setup_delegate ( wClipboardDelegate *  delegate)
static

Here is the call graph for this function:

Here is the caller graph for this function: