Ruby
2.1.10p492(2016-04-01revision54464)
|
#include "ruby/ruby.h"
#include "ruby/encoding.h"
#include "ruby/thread.h"
#include "internal.h"
#include <winbase.h>
#include <wchar.h>
#include <shlwapi.h>
Go to the source code of this file.
Data Structures | |
struct | code_page_table |
Macros | |
#define | INVALID_FILE_ATTRIBUTES ((DWORD)-1) |
#define | IS_DIR_SEPARATOR_P(c) (c == L'\\' || c == L'/') |
#define | IS_DIR_UNC_P(c) (IS_DIR_SEPARATOR_P(c[0]) && IS_DIR_SEPARATOR_P(c[1])) |
#define | INVALID_CODE_PAGE 51932 |
#define | PATH_BUFFER_SIZE MAX_PATH * 2 |
#define | insecure_obj_p(obj, level) ((level) >= 4 || ((level) > 0 && OBJ_TAINTED(obj))) |
#define | fix_string_encoding(str, encoding) rb_str_conv_enc((str), (encoding), rb_utf8_encoding()) |
Variables | |
static struct code_page_table | rb_code_page |
#define fix_string_encoding | ( | str, | |
encoding | |||
) | rb_str_conv_enc((str), (encoding), rb_utf8_encoding()) |
Definition at line 225 of file file.c.
Referenced by rb_file_expand_path_internal().
#define INVALID_CODE_PAGE 51932 |
Definition at line 23 of file file.c.
Referenced by code_page(), code_page_i(), get_user_from_path(), and rb_file_expand_path_internal().
#define INVALID_FILE_ATTRIBUTES ((DWORD)-1) |
Definition at line 10 of file file.c.
Referenced by rb_file_load_ok().
Definition at line 19 of file file.c.
Referenced by get_user_from_path(), rb_file_expand_path_internal(), remove_invalid_alternative_data(), and replace_to_long_name().
#define IS_DIR_UNC_P | ( | c | ) | (IS_DIR_SEPARATOR_P(c[0]) && IS_DIR_SEPARATOR_P(c[1])) |
Definition at line 20 of file file.c.
Referenced by rb_file_expand_path_internal().
#define PATH_BUFFER_SIZE MAX_PATH * 2 |
Definition at line 24 of file file.c.
Referenced by rb_file_expand_path_internal().
|
static |
Definition at line 205 of file file.c.
References code_page_table::count, INVALID_CODE_PAGE, rb_ascii8bit_encindex, rb_code_page, rb_enc_to_index, rb_usascii_encindex, system_code_page(), and code_page_table::table.
Referenced by code_page_i(), and rb_file_expand_path_internal().
Definition at line 178 of file file.c.
References code_page(), code_page_table::count, count, cp, i, idx, INVALID_CODE_PAGE, n, realloc(), ST_CONTINUE, code_page_table::table, and table.
Referenced by Init_w32_codepage().
|
inlinestatic |
Definition at line 40 of file file.c.
References len, NULL, and xmalloc.
Referenced by rb_file_expand_path_internal(), and rb_file_load_ok().
|
inlinestatic |
Definition at line 298 of file file.c.
References convert_wchar_to_mb(), INVALID_CODE_PAGE, IS_DIR_SEPARATOR_P, Qnil, rb_enc_from_encoding(), rb_enc_str_new(), rb_str_encode(), rb_str_resize(), rb_utf8_encoding(), result, size, tmp, and xfree.
Referenced by rb_file_expand_path_internal().
|
static |
Definition at line 73 of file file.c.
References len, NULL, replace_wchar(), and xmalloc.
Referenced by rb_file_expand_path_internal().
Definition at line 712 of file file.c.
References code_page_i(), code_page_table::count, rb_code_page, rb_enc_foreach_name(), and st_data_t.
Referenced by rb_locale_encindex().
void rb_enc_foreach_name | ( | int(*)(st_data_t name, st_data_t idx, st_data_t arg) | func, |
st_data_t | arg | ||
) |
Definition at line 1964 of file encoding.c.
References enc_table, func, and st_foreach().
Referenced by Init_w32_codepage().
VALUE rb_file_expand_path_internal | ( | VALUE | fname, |
VALUE | dname, | ||
int | abs_mode, | ||
int | long_name, | ||
VALUE | result | ||
) |
Definition at line 329 of file file.c.
References ALLOCA_N, ALLOCV_END, ALLOCV_N, append_fspath(), b, buf, BUFCHECK, BUFINIT, bufsize, chompdirsep(), code_page(), convert_mb_to_wchar(), cp, e, enc, ENC_CODERANGE_7BIT, ENC_CODERANGE_CLEAR, fix_string_encoding, flags, get_user_from_path(), home_dir(), Inc, int, INVALID_CODE_PAGE, IS_DIR_SEPARATOR_P, IS_DIR_UNC_P, isdirsep, istrailinggarbage, len, lstat, MAXPATHLEN, memcpy(), memset(), my_getcwd, n, nextdirsep, NIL_P(), NULL, OBJ_TAINT, OBJ_TAINTED, p, path, PATH_BUFFER_SIZE, PRIsVALUE, Qnil, rb_default_home_dir(), rb_eArgError, rb_enc_associate(), rb_enc_check(), rb_enc_copy(), rb_enc_from_encoding(), rb_enc_get(), rb_enc_raise(), rb_enc_str_asciionly_p(), rb_enc_str_coderange(), rb_file_expand_path_internal(), rb_filesystem_encoding(), rb_home_dir_of(), rb_is_absolute_path(), rb_raise(), rb_str_buf_cat(), rb_str_encode(), rb_str_encode_ospath(), rb_str_modify(), rb_str_resize(), rb_str_set_len(), rb_utf8_encoding(), remove_invalid_alternative_data(), replace_to_long_name(), replace_wchar(), result, RSTRING_LEN, RSTRING_PTR, s, S_ISLNK, size, skipprefix, skiproot(), stat, STRCASECMP, StringValuePtr, strlcat(), strlen(), strncasecmp, strrdirsep, system_code_page(), tmp, TOLOWER, v, xfree, and xmalloc.
Referenced by file_expand_path_1(), rb_file_expand_path_internal(), rb_find_file_ext_safe(), and rb_find_file_safe().
Definition at line 683 of file file.c.
References convert_mb_to_wchar(), fstat, int, INVALID_FILE_ATTRIBUTES, len, loadopen_func(), rb_thread_call_without_gvl(), rb_update_max_fd(), ret, RUBY_UBF_IO, S_ISREG, stat, void, and xfree.
Referenced by rb_f_load(), rb_find_file_ext_safe(), and rb_find_file_safe().
|
inlinestatic |
Definition at line 138 of file file.c.
References IS_DIR_SEPARATOR_P, and size.
Referenced by rb_file_expand_path_internal().
|
inlinestatic |
Definition at line 232 of file file.c.
References buf, IS_DIR_SEPARATOR_P, size, xfree, and xmalloc.
Referenced by rb_file_expand_path_internal().
Definition at line 29 of file file.c.
Referenced by home_dir(), and rb_file_expand_path_internal().
|
inlinestatic |
Definition at line 170 of file file.c.
Referenced by code_page(), and rb_file_expand_path_internal().
|
static |
Referenced by code_page(), and Init_w32_codepage().