MySQL 9.6.0
Source Code Documentation
mysql_file_imp.h
Go to the documentation of this file.
1/* Copyright (c) 2020, 2025, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef MYSQL_FILE_IMP_H
25#define MYSQL_FILE_IMP_H
26
29
30/**
31 Implementation of the "mysql_file" component service that uses server's file
32 manipulation API.
33*/
35 public:
36 /**
37 Wrapper around my_open function.
38
39 @see my_open
40 */
41 static DEFINE_METHOD(FILE_h, open, (const char *file_name, int flags));
42
43 /**
44 Wrapper around my_create function.
45
46 @see my_create
47 */
49 (const char *file_name, int flags,
50 int permission_flags));
51
52 /**
53 Wrapper around my_close function.
54
55 @see my_close
56 */
57 static DEFINE_METHOD(int, close, (FILE_h file));
58
59 /**
60 Wrapper around my_write function.
61
62 @see my_write
63 */
64 static DEFINE_METHOD(size_t, write,
65 (FILE_h file, const unsigned char *data, size_t size));
66
67 /**
68 Wrapper around my_read function.
69
70 @see my_read
71 */
72 static DEFINE_METHOD(size_t, read,
73 (FILE_h file, unsigned char *data, size_t size));
74
75 /**
76 Wrapper around my_flush function.
77
78 @see my_flush
79 */
80 static DEFINE_METHOD(int, flush, (FILE_h file));
81
82 /**
83 Wrapper around my_seek function.
84
85 @see my_seek
86 */
87 static DEFINE_METHOD(unsigned long long, seek,
88 (FILE_h file, unsigned long long pos, int whence));
89
90 /**
91 Wrapper around my_tell function.
92
93 @see my_tell
94 */
95 static DEFINE_METHOD(unsigned long long, tell, (FILE_h file));
96};
97
98#endif /* MYSQL_CURRENT_THREAD_READER_IMP_H */
Implementation of the "mysql_file" component service that uses server's file manipulation API.
Definition: mysql_file_imp.h:34
static unsigned long long seek(FILE_h file, unsigned long long pos, int whence) noexcept
Wrapper around my_seek function.
Definition: mysql_file_imp.cc:197
static unsigned long long tell(FILE_h file) noexcept
Wrapper around my_tell function.
Definition: mysql_file_imp.cc:206
static int flush(FILE_h file) noexcept
Wrapper around my_flush function.
Definition: mysql_file_imp.cc:192
static size_t write(FILE_h file, const unsigned char *data, size_t size) noexcept
Wrapper around my_write function.
Definition: mysql_file_imp.cc:181
static int close(FILE_h file) noexcept
Wrapper around my_close function.
Definition: mysql_file_imp.cc:170
static FILE_h open(const char *file_name, int flags) noexcept
Wrapper around my_open function.
Definition: mysql_file_imp.cc:134
static size_t read(FILE_h file, unsigned char *data, size_t size) noexcept
Wrapper around my_read function.
Definition: mysql_file_imp.cc:187
static FILE_h create(const char *file_name, int flags, int permission_flags) noexcept
Wrapper around my_create function.
Definition: mysql_file_imp.cc:152
struct FILE_h_imp * FILE_h
Definition: mysql_file.h:136
static int flags[50]
Definition: hp_test1.cc:40
static const char * whence(const Item_field *cached_field)
Get the name of the cached field of an Item_cache_json instance.
Definition: item.cc:10083
Definition: os0file.h:89
std::string file_name(Log_file_id file_id)
Provides name of the log file with the given file id, e.g.
Definition: log0pre_8_0_30.cc:94
size_t size(const char *const c)
Definition: base64.h:46
Specifies macros to define Service Implementations.
#define DEFINE_METHOD(retval, name, args)
A macro to ensure method implementation has required properties, that is it does not throw exceptions...
Definition: service_implementation.h:79