diff options
author | unknown <marko@hundin.mysql.fi> | 2004-05-17 14:40:31 +0300 |
---|---|---|
committer | unknown <marko@hundin.mysql.fi> | 2004-05-17 14:40:31 +0300 |
commit | 6b237533f1baae131e192ccbafcfcfaef13f4fc0 (patch) | |
tree | 17e1fcb0d47194292389b6b6d5d0b78c2695e328 /innobase/include/os0file.h | |
parent | 1915bfebcb9005102c72028221bb89aa5f0204e4 (diff) | |
download | mariadb-git-6b237533f1baae131e192ccbafcfcfaef13f4fc0.tar.gz |
InnoDB cleanup: Add const qualifiers to many char* arguments
innobase/dict/dict0dict.c:
Replace char* arguments with const char*
innobase/dict/dict0load.c:
Replace char* arguments with const char*
innobase/dict/dict0mem.c:
Replace char* arguments with const char*
innobase/fil/fil0fil.c:
Replace char* arguments with const char*
innobase/include/data0data.h:
dfield_set_data(): add const qualifier
innobase/include/data0data.ic:
dfield_set_data(): add const qualifier
(temporarily shut up compiler warnings)
innobase/include/dict0dict.h:
Replace char* arguments with const char*
innobase/include/dict0dict.ic:
Replace char* arguments with const char*
innobase/include/dict0load.h:
Replace char* arguments with const char*
innobase/include/dict0mem.h:
Replace char* arguments with const char*
innobase/include/fil0fil.h:
Replace char* arguments with const char*
innobase/include/os0file.h:
Replace char* arguments with const char*
innobase/include/os0sync.h:
Replace char* arguments with const char*
innobase/include/pars0pars.h:
Replace char* arguments with const char*
innobase/include/pars0sym.h:
Replace char* arguments with const char*
innobase/include/row0mysql.h:
Replace char* arguments with const char*
innobase/include/row0sel.h:
Replace char* arguments with const char*
innobase/include/trx0roll.h:
Replace char* arguments with const char*
innobase/include/trx0sys.h:
Replace char* arguments with const char*
innobase/include/trx0trx.h:
Replace char* arguments with const char*
innobase/include/ut0rnd.h:
Replace char* arguments with const char*
innobase/include/ut0rnd.ic:
Replace char* arguments with const char*
innobase/include/ut0ut.h:
Remove unused function ut_printf()
innobase/os/os0file.c:
Replace char* arguments with const char*
innobase/os/os0sync.c:
Replace char* arguments with const char*
innobase/pars/pars0pars.c:
Replace char* arguments with const char*
innobase/pars/pars0sym.c:
Use mem_heap_strdupl() instead of mem_heap_alloc() and memcpy()
innobase/row/row0mysql.c:
Replace char* arguments with const char*
innobase/row/row0sel.c:
Replace char* arguments with const char*
innobase/trx/trx0roll.c:
Replace char* arguments with const char*
innobase/trx/trx0sys.c:
Replace char* arguments with const char*
Diffstat (limited to 'innobase/include/os0file.h')
-rw-r--r-- | innobase/include/os0file.h | 156 |
1 files changed, 83 insertions, 73 deletions
diff --git a/innobase/include/os0file.h b/innobase/include/os0file.h index 3eccfcd3be5..930390241d3 100644 --- a/innobase/include/os0file.h +++ b/innobase/include/os0file.h @@ -177,13 +177,15 @@ and '..' items at the start of the directory listing. */ os_file_dir_t os_file_opendir( /*============*/ - /* out: directory stream, NULL if error */ - char* dirname, /* in: directory name; it must not contain - a trailing '\' or '/' */ - ibool error_is_fatal);/* in: TRUE if we should treat an error as a - fatal error; if we try to open symlinks then - we do not wish a fatal error if it happens - not to be a directory */ + /* out: directory stream, NULL if + error */ + const char* dirname, /* in: directory name; it must not + contain a trailing '\' or '/' */ + ibool error_is_fatal);/* in: TRUE if we should treat an + error as a fatal error; if we try to + open symlinks then we do not wish a + fatal error if it happens not to be + a directory */ /*************************************************************************** Closes a directory stream. */ @@ -201,7 +203,7 @@ os_file_readdir_next_file( /*======================*/ /* out: 0 if ok, -1 if error, 1 if at the end of the directory */ - char* dirname,/* in: directory name or path */ + const char* dirname,/* in: directory name or path */ os_file_dir_t dir, /* in: directory stream */ os_file_stat_t* info); /* in/out: buffer where the info is returned */ /********************************************************************* @@ -213,81 +215,89 @@ fail_if_exists arguments is true. */ ibool os_file_create_directory( /*=====================*/ - /* out: TRUE if call succeeds, FALSE on - error */ - char* pathname, /* in: directory name as null-terminated - string */ - ibool fail_if_exists);/* in: if TRUE, pre-existing directory is - treated as an error. */ + /* out: TRUE if call succeeds, + FALSE on error */ + const char* pathname, /* in: directory name as + null-terminated string */ + ibool fail_if_exists);/* in: if TRUE, pre-existing directory + is treated as an error. */ /******************************************************************** A simple function to open or create a file. */ os_file_t os_file_create_simple( /*==================*/ - /* out, own: handle to the file, not defined if error, - error number can be retrieved with - os_file_get_last_error */ - char* name, /* in: name of the file or path as a null-terminated - string */ - ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened - (if does not exist, error), or OS_FILE_CREATE if a new - file is created (if exists, error), or - OS_FILE_CREATE_PATH if new file (if exists, error) and - subdirectories along its path are created (if needed)*/ - ulint access_type,/* in: OS_FILE_READ_ONLY or OS_FILE_READ_WRITE */ - ibool* success);/* out: TRUE if succeed, FALSE if error */ + /* out, own: handle to the file, not defined + if error, error number can be retrieved with + os_file_get_last_error */ + const char* name, /* in: name of the file or path as a + null-terminated string */ + ulint create_mode,/* in: OS_FILE_OPEN if an existing file is + opened (if does not exist, error), or + OS_FILE_CREATE if a new file is created + (if exists, error), or + OS_FILE_CREATE_PATH if new file + (if exists, error) and subdirectories along + its path are created (if needed)*/ + ulint access_type,/* in: OS_FILE_READ_ONLY or + OS_FILE_READ_WRITE */ + ibool* success);/* out: TRUE if succeed, FALSE if error */ /******************************************************************** A simple function to open or create a file. */ os_file_t os_file_create_simple_no_error_handling( /*====================================*/ - /* out, own: handle to the file, not defined if error, - error number can be retrieved with - os_file_get_last_error */ - char* name, /* in: name of the file or path as a null-terminated - string */ - ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened - (if does not exist, error), or OS_FILE_CREATE if a new - file is created (if exists, error) */ - ulint access_type,/* in: OS_FILE_READ_ONLY, OS_FILE_READ_WRITE, or - OS_FILE_READ_ALLOW_DELETE; the last option is used by - a backup program reading the file */ - ibool* success);/* out: TRUE if succeed, FALSE if error */ + /* out, own: handle to the file, not defined + if error, error number can be retrieved with + os_file_get_last_error */ + const char* name, /* in: name of the file or path as a + null-terminated string */ + ulint create_mode,/* in: OS_FILE_OPEN if an existing file + is opened (if does not exist, error), or + OS_FILE_CREATE if a new file is created + (if exists, error) */ + ulint access_type,/* in: OS_FILE_READ_ONLY, + OS_FILE_READ_WRITE, or + OS_FILE_READ_ALLOW_DELETE; the last option is + used by a backup program reading the file */ + ibool* success);/* out: TRUE if succeed, FALSE if error */ /******************************************************************** Opens an existing file or creates a new. */ os_file_t os_file_create( /*===========*/ - /* out, own: handle to the file, not defined if error, - error number can be retrieved with - os_file_get_last_error */ - char* name, /* in: name of the file or path as a null-terminated - string */ - ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened - (if does not exist, error), or OS_FILE_CREATE if a new - file is created (if exists, error), OS_FILE_OVERWRITE - if a new file is created or an old overwritten; - OS_FILE_OPEN_RAW, if a raw device or disk partition - should be opened */ - ulint purpose,/* in: OS_FILE_AIO, if asynchronous, non-buffered i/o - is desired, OS_FILE_NORMAL, if any normal file; - NOTE that it also depends on type, os_aio_.. and srv_.. - variables whether we really use async i/o or - unbuffered i/o: look in the function source code for - the exact rules */ - ulint type, /* in: OS_DATA_FILE or OS_LOG_FILE */ - ibool* success);/* out: TRUE if succeed, FALSE if error */ + /* out, own: handle to the file, not defined + if error, error number can be retrieved with + os_file_get_last_error */ + const char* name, /* in: name of the file or path as a + null-terminated string */ + ulint create_mode,/* in: OS_FILE_OPEN if an existing file + is opened (if does not exist, error), or + OS_FILE_CREATE if a new file is created + (if exists, error), + OS_FILE_OVERWRITE if a new file is created + or an old overwritten; + OS_FILE_OPEN_RAW, if a raw device or disk + partition should be opened */ + ulint purpose,/* in: OS_FILE_AIO, if asynchronous, + non-buffered i/o is desired, + OS_FILE_NORMAL, if any normal file; + NOTE that it also depends on type, os_aio_.. + and srv_.. variables whether we really use + async i/o or unbuffered i/o: look in the + function source code for the exact rules */ + ulint type, /* in: OS_DATA_FILE or OS_LOG_FILE */ + ibool* success);/* out: TRUE if succeed, FALSE if error */ /*************************************************************************** Deletes a file. The file has to be closed before calling this. */ ibool os_file_delete( /*===========*/ - /* out: TRUE if success */ - char* name); /* in: file path as a null-terminated string */ + /* out: TRUE if success */ + const char* name); /* in: file path as a null-terminated string */ /*************************************************************************** Deletes a file if it exists. The file has to be closed before calling this. */ @@ -295,8 +305,8 @@ Deletes a file if it exists. The file has to be closed before calling this. */ ibool os_file_delete_if_exists( /*=====================*/ - /* out: TRUE if success */ - char* name); /* in: file path as a null-terminated string */ + /* out: TRUE if success */ + const char* name); /* in: file path as a null-terminated string */ /*************************************************************************** Renames a file (can also move it to another directory). It is safest that the file is closed before calling this function. */ @@ -304,10 +314,10 @@ file is closed before calling this function. */ ibool os_file_rename( /*===========*/ - /* out: TRUE if success */ - char* oldpath, /* in: old file path as a null-terminated - string */ - char* newpath); /* in: new file path */ + /* out: TRUE if success */ + const char* oldpath, /* in: old file path as a + null-terminated string */ + const char* newpath); /* in: new file path */ /*************************************************************************** Closes a file handle. In case of error, error number can be retrieved with os_file_get_last_error. */ @@ -351,7 +361,7 @@ ibool os_file_set_size( /*=============*/ /* out: TRUE if success */ - char* name, /* in: name of the file or path as a + const char* name, /* in: name of the file or path as a null-terminated string */ os_file_t file, /* in: handle to a file */ ulint size, /* in: least significant 32 bits of file @@ -426,10 +436,10 @@ os_file_write( /*==========*/ /* out: TRUE if request was successful, FALSE if fail */ - char* name, /* in: name of the file or path as a + const char* name, /* in: name of the file or path as a null-terminated string */ os_file_t file, /* in: handle to a file */ - void* buf, /* in: buffer from which to write */ + const void* buf, /* in: buffer from which to write */ ulint offset, /* in: least significant 32 bits of file offset where to write */ ulint offset_high,/* in: most significant 32 bits of @@ -442,8 +452,8 @@ ibool os_file_status( /*===========*/ /* out: TRUE if call succeeded */ - char * path, /* in: pathname of the file */ - ibool * exists, /* out: TRUE if file exists */ + const char* path, /* in: pathname of the file */ + ibool* exists, /* out: TRUE if file exists */ os_file_type_t* type); /* out: type of the file (if it exists) */ /******************************************************************** The function os_file_dirname returns a directory component of a @@ -478,7 +488,7 @@ os_file_dirname( /*============*/ /* out, own: directory component of the pathname */ - char* path); /* in: pathname */ + const char* path); /* in: pathname */ /******************************************************************** Creates all missing subdirectories along the given path. */ @@ -487,7 +497,7 @@ os_file_create_subdirs_if_needed( /*=============================*/ /* out: TRUE if call succeeded FALSE otherwise */ - char* path); /* in: path name */ + const char* path); /* in: path name */ /**************************************************************************** Initializes the asynchronous io system. Creates separate aio array for non-ibuf read and write, a third aio array for the ibuf i/o, with just one @@ -527,7 +537,7 @@ os_aio( because i/os are not actually handled until all have been posted: use with great caution! */ - char* name, /* in: name of the file or path as a + const char* name, /* in: name of the file or path as a null-terminated string */ os_file_t file, /* in: handle to a file */ void* buf, /* in: buffer where to read or from which |