Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
|
#include "ruby/ruby.h"
#include "ruby/encoding.h"
#include "internal.h"
#include "internal/error.h"
#include <winbase.h>
#include <wchar.h>
#include <shlwapi.h>
#include "win32/file.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) > 0 && OBJ_TAINTED(obj)) |
#define | system_code_page rb_w32_filecp |
#define | mbstr_to_wstr rb_w32_mbstr_to_wstr |
#define | wstr_to_mbstr rb_w32_wstr_to_mbstr |
#define | fix_string_encoding(str, encoding) rb_str_conv_enc((str), (encoding), rb_utf8_encoding()) |
Functions | |
void | rb_enc_foreach_name (int(*func)(st_data_t name, st_data_t idx, st_data_t arg), st_data_t arg) |
VALUE | rb_default_home_dir (VALUE result) |
VALUE | rb_file_expand_path_internal (VALUE fname, VALUE dname, int abs_mode, int long_name, VALUE result) |
VALUE | rb_readlink (VALUE path, rb_encoding *resultenc) |
int | rb_file_load_ok (const char *path) |
int | rb_freopen (VALUE fname, const char *mode, FILE *file) |
void | Init_w32_codepage (void) |
#define fix_string_encoding | ( | str, | |
encoding | |||
) | rb_str_conv_enc((str), (encoding), rb_utf8_encoding()) |
#define insecure_obj_p | ( | obj, | |
level | |||
) | ((level) > 0 && OBJ_TAINTED(obj)) |
#define IS_DIR_UNC_P | ( | c | ) | (IS_DIR_SEPARATOR_P(c[0]) && IS_DIR_SEPARATOR_P(c[1])) |
#define mbstr_to_wstr rb_w32_mbstr_to_wstr |
#define system_code_page rb_w32_filecp |
#define wstr_to_mbstr rb_w32_wstr_to_mbstr |
void Init_w32_codepage | ( | void | ) |
Definition at line 723 of file file.c.
References rb_enc_foreach_name().
Referenced by rb_locale_encindex().
Definition at line 264 of file file.c.
References rb_eArgError, rb_filesystem_encoding(), rb_raise(), rb_w32_filecp(), rb_w32_home_dir(), and xfree.
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 2208 of file encoding.c.
References GLOBAL_ENC_TABLE_EVAL, 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 277 of file file.c.
References ALLOC_N, fix_string_encoding, free, INVALID_CODE_PAGE, IS_DIR_SEPARATOR_P, IS_DIR_UNC_P, L, mbstr_to_wstr, NIL_P, NULL, OBJ_TAINT, OBJ_TAINTED, PATH_BUFFER_SIZE, rb_eArgError, rb_enc_associate(), rb_enc_check(), rb_enc_get(), rb_enc_str_asciionly_p(), rb_eRangeError, rb_exc_new_str(), rb_exc_raise(), rb_filesystem_encoding(), rb_raise(), rb_str_new_cstr, rb_str_set_len(), rb_w32_home_dir(), RSTRING_LEN, RSTRING_PTR, and xfree.
Definition at line 663 of file file.c.
References free, INVALID_FILE_ATTRIBUTES, INVALID_HANDLE_VALUE, len, mbstr_to_wstr, and NULL.
Definition at line 694 of file file.c.
References ALLOCV_END, ALLOCV_N, L, len, name, NULL, numberof, RB_GC_GUARD, rb_long2int, and RSTRING_GETMEM.
VALUE rb_readlink | ( | VALUE | path, |
rb_encoding * | resultenc | ||
) |
Definition at line 619 of file file.c.
References ALLOCV, ALLOCV_END, ALLOCV_N, FilePathValue, fix_string_encoding, INVALID_CODE_PAGE, L, len, NULL, rb_enc_get(), rb_enc_str_new(), rb_syserr_fail_path, rb_w32_map_errno(), rb_w32_read_reparse_point(), rb_w32_reparse_buffer_size, rp, RSTRING_LEN, RSTRING_PTR, and str.