Ruby: include/ruby/internal/intern/file.h Source File

Ruby 3.3.5p100 (2024-09-03 revision ef084cc8f4958c1b6e4ead99136631bef6d8ddba)

file.h
Go to the documentation of this file.
1#ifndef RBIMPL_INTERN_FILE_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_INTERN_FILE_H
23#include "ruby/internal/attr/nonnull.h"
24#include "ruby/internal/attr/pure.h"
25#include "ruby/internal/dllexport.h"
26#include "ruby/internal/value.h"
27
28 RBIMPL_SYMBOL_EXPORT_BEGIN()
29
30/* file.c */
31
32 RBIMPL_ATTR_NONNULL(())
47 VALUE rb_file_s_expand_path(int argc, const VALUE *argv);
48
63 VALUE rb_file_expand_path(VALUE fname, VALUE dname);
64
65 RBIMPL_ATTR_NONNULL(())
80 VALUE rb_file_s_absolute_path(int argc, const VALUE *argv);
81
96 VALUE rb_file_absolute_path(VALUE fname, VALUE dname);
97
114 VALUE rb_file_dirname(VALUE fname);
115
116 RBIMPL_ATTR_NONNULL(())
134int rb_find_file_ext(VALUE *feature, const char *const *exts);
135
147 VALUE rb_find_file(VALUE path);
148
163 VALUE rb_file_directory_p(VALUE _, VALUE path);
164
175 VALUE rb_str_encode_ospath(VALUE path);
176
177 RBIMPL_ATTR_NONNULL(())
178 RBIMPL_ATTR_PURE()
188int rb_is_absolute_path(const char *path);
189
209rb_off_t rb_file_size(VALUE file);
210
211 RBIMPL_SYMBOL_EXPORT_END()
212
213#endif /* RBIMPL_INTERN_FILE_H */
dllexport.h
Tweaking visibility of C variables/functions.
RBIMPL_SYMBOL_EXPORT_END
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition dllexport.h:74
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:65
rb_find_file
VALUE rb_find_file(VALUE path)
Identical to rb_find_file_ext(), except it takes a feature name and is extension at once,...
Definition file.c:6486
rb_file_s_absolute_path
VALUE rb_file_s_absolute_path(int argc, const VALUE *argv)
Identical to rb_file_absolute_path(), except how arguments are passed.
Definition file.c:4174
rb_str_encode_ospath
VALUE rb_str_encode_ospath(VALUE path)
Converts a string into an "OS Path" encoding, if any.
Definition file.c:252
rb_is_absolute_path
int rb_is_absolute_path(const char *path)
Queries if the given path is an absolute path.
Definition file.c:6247
rb_find_file_ext
int rb_find_file_ext(VALUE *feature, const char *const *exts)
Resolves a feature's path.
Definition file.c:6427
rb_file_s_expand_path
VALUE rb_file_s_expand_path(int argc, const VALUE *argv)
Identical to rb_file_expand_path(), except how arguments are passed.
Definition file.c:4126
rb_file_size
rb_off_t rb_file_size(VALUE file)
Queries the file size of the given file.
Definition file.c:2517
rb_file_directory_p
VALUE rb_file_directory_p(VALUE _, VALUE path)
Queries if the given path is either a directory, or a symlink that (potentially recursively) points t...
Definition file.c:1615
rb_file_expand_path
VALUE rb_file_expand_path(VALUE fname, VALUE dname)
Identical to rb_file_absolute_path(), except it additionally understands ~.
Definition file.c:4113
rb_file_dirname
VALUE rb_file_dirname(VALUE fname)
Strips a file path's last component (and trailing separators if any).
Definition file.c:4780
rb_file_absolute_path
VALUE rb_file_absolute_path(VALUE fname, VALUE dname)
Maps a relative path to its absolute representation.
Definition file.c:4167
nonnull.h
Defines RBIMPL_ATTR_NONNULL.
RBIMPL_ATTR_NONNULL
#define RBIMPL_ATTR_NONNULL(list)
Wraps (or simulates) __attribute__((nonnull))
Definition nonnull.h:30
pure.h
Defines RBIMPL_ATTR_PURE.
RBIMPL_ATTR_PURE
#define RBIMPL_ATTR_PURE()
Wraps (or simulates) __attribute__((pure))
Definition pure.h:33
_
#define _(args)
This was a transition path from K&R to ANSI.
Definition stdarg.h:35
value.h
Defines VALUE and ID.
VALUE
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40