#include "ktypes.h"
Defines | |
| #define | k_stdin k_std_stream (K_ISTDIN) |
| Gets a KFILE structure for standard input stream. | |
| #define | k_stdout k_std_stream (K_ISTDOUT) |
| Gets a KFILE structure for standard output stream. | |
| #define | k_stderr k_std_stream (K_ISTDERR) |
| Gets a KFILE structure for standard error stream. | |
| #define | k_fopen(sPath, sMode) k_fopen_info (sPath, sMode, __K_FILE__, __K_LINE__) |
| Opens the file whose name is specified and associates it with a KFILE structure. The operations that are allowed are also specified. | |
| #define | k_fmopen(sPath, eMode) k_fmopen_info (sPath, eMode, __K_FILE__, __K_LINE__) |
| Opens the file whose name is specified and associates it with a KFILE structure. The operations that are allowed are also specified. | |
| #define | k_fclose(f) |
| Closes the file associated with the given KFILE structure. | |
| #define | K_NOT_IMPLEMENTED |
| K_NOT_IMPLEMENTED. Writes in debug mode in the standard output a warning message that indicates that the current function is not implemented. | |
| #define | ktrace k_debug ("%s : %ld\n", __K_FUNCTION__, __K_LINE__) |
| Writes in debug mode to the standard output an execution trace. | |
| #define | KFILE_newBuffer() _KFILE_newBuffer (__K_FILE__, __K_LINE__) |
| Creates a buffer represented by a KFILE structure. | |
Typedefs | |
| typedef _KFILE | KFILE |
| File stream redefinition. | |
Enumerations | |
| enum | ESeekMode { K_SEEK_SET = 0, K_SEEK_CUR = 1, K_SEEK_END = 2 } |
| Seek modes. More... | |
| enum | EOpenMode { K_OPEN_READ = 0x01, K_OPEN_WRITE = 0x02, K_OPEN_READWRITE = 0x03, K_OPEN_BEGIN = 0x10, K_OPEN_END = 0x20 } |
| enum | |
| Type of stream: input, error or output. | |
Functions | |
| KTL_API KFILE * | k_std_stream (KInt i) |
| Gets a KFILE structure for specific streams. | |
| KTL_API KBool | k_frename (KCString sOldPath, KCString sNewPath) |
| Changes the name of the file or directory If the two strings specify different paths and this is supported by the system, the file is moved to the new location. | |
| KTL_API KBool | k_fcopy (KCString sOldPath, KCString sNewPath) |
| Copy a file or a directory. | |
| KTL_API KBool | k_fremove (KCString sFilePath) |
| Deletes the file whose named is specified. | |
| KTL_API KBool | k_feof (KFILE *f) |
| Checks whether the end of file indicator is set. | |
| KTL_API KFILE * | k_fopen_info (KCString path, KCString mode, KString sFile, KInt32 iLine) |
| Opens the file whose name is specified and associates it with a KFILE structure. The operations that are allowed are also specified. | |
| KTL_API KFILE * | k_fmopen_info (KCString path, EOpenMode eMode, KString sFile, KInt32 iLine) |
| Opens the file whose name is specified and associates it with a KFILE structure. The operations that are allowed are also specified. | |
| KTL_API void | k_fclose_info (KFILE *f, KString file, KInt32 line) |
| Closes the file associated with the given KFILE structure. | |
| KTL_API KInt32 | k_ftell (KFILE *f) |
| Returns the current value of the position indicator in the specified file. | |
| KTL_API k_size_t | k_fwrite (KCPtr buffer, k_size_t size, k_size_t nmemb, KFILE *f) |
| Writes an array of elements each one with a size from the block of memory pointed to the current position in the file. | |
| KTL_API k_size_t | k_fread (KPtr buffer, k_size_t size, k_size_t nmemb, KFILE *f) |
| Reads an array of elements each one with a size from the file and stores them in the block of memory specified. The position indicator is advanced by the total amount of bytes read. | |
| KTL_API KInt | k_fseek (KFILE *f, KInt32 v, ESeekMode mode) |
| Sets the position indicator to a new position. | |
| KTL_API KInt | k_flush (KFILE *stream) |
| If the given file was open for writing and the last input/output operation was an output operation, any unwritten data in the output buffer is written to the file. If the parameter is a null pointer, all open files are flushed. The file remains open after this call. | |
| KTL_API KBool | k_mkdir (KCString sPath) |
| Creates a directory. | |
| KTL_API void | k_print_std (KCString format,...) |
| Writes to the standard output a sequence of data formatted as the format parameter specifies. | |
| KTL_API void | k_print_err (KCString format,...) |
| Writes to the error output a sequence of data formatted as the format parameter specifies. | |
| KTL_API void | k_debug (KCString format,...) |
| Writes in debug mode to the standard output. This function can write too in the debug file "debug.log" only if the file is open by the mean of the k_open_debug_file() function. | |
| KTL_API void | k_close_debug_file () |
| Closes the debug file "debug.log". | |
| KTL_API void | k_open_debug_file () |
| Opens the debug file "debug.log". | |
| KTL_API void | k_print_mutex () |
| Writes to the standard output the states of the mutex. | |
| KTL_API KBool | k_log_open (KString path) |
| Opens the debug file specified as a parameter. | |
| KTL_API KBool | k_log_print (KCString format,...) |
| Writes in a debug file a sequence of data formatted as the format parameter specifies. | |
| KTL_API void | k_log_close () |
| Closes a debug file. | |
| KTL_API KInt | k_sprintf (KString str, KCString format,...) |
| Writes in a string a sequence of data formatted as the format parameters specifies. | |
| KTL_API KInt | k_snprintf (KString str, k_size_t size, KCString format,...) |
| Writes in a string a sequence of data formatted with both size and format specified. | |
| KTL_API KString | k_fgets (KString s, KInt size, KFILE *stream) |
| Reads characters from a file and stores them in a string until characters have been read or either a newline or the end of file is reached. | |
| KTL_API KFILE * | _KFILE_newBuffer (KString file, KInt32 line) |
| Creates a buffer represented by a KFILE structure. | |
| KTL_API const KUChar * | KFILE_getBuffer (KFILE *f, KUInt64 *iBytes) |
| Gets the buffer represented by a KFILE structure. | |
|
|
Value: Closes the file associated with the given KFILE structure.
|
|
|
Opens the file whose name is specified and associates it with a KFILE structure. The operations that are allowed are also specified.
|
|
|
Opens the file whose name is specified and associates it with a KFILE structure. The operations that are allowed are also specified.
|
|
|
Gets a KFILE structure for standard error stream.
|
|
|
Gets a KFILE structure for standard input stream.
|
|
|
Gets a KFILE structure for standard output stream.
|
|
|
Creates a buffer represented by a KFILE structure.
|
|
|
|
|
|
Seek modes.
|
|
||||||||||||
|
Creates a buffer represented by a KFILE structure.
|
|
||||||||||||
|
Writes in debug mode to the standard output. This function can write too in the debug file "debug.log" only if the file is open by the mean of the k_open_debug_file() function.
|
|
||||||||||||||||
|
Closes the file associated with the given KFILE structure.
|
|
||||||||||||
|
Copy a file or a directory. If the two strings specify different paths and this is supported by the system, the file is copy to the new location
|
|
|
Checks whether the end of file indicator is set.
|
|
||||||||||||||||
|
Reads characters from a file and stores them in a string until characters have been read or either a newline or the end of file is reached.
|
|
|
If the given file was open for writing and the last input/output operation was an output operation, any unwritten data in the output buffer is written to the file. If the parameter is a null pointer, all open files are flushed. The file remains open after this call.
|
|
||||||||||||||||||||
|
Opens the file whose name is specified and associates it with a KFILE structure. The operations that are allowed are also specified.
|
|
||||||||||||||||||||
|
Opens the file whose name is specified and associates it with a KFILE structure. The operations that are allowed are also specified.
|
|
||||||||||||||||||||
|
Reads an array of elements each one with a size from the file and stores them in the block of memory specified. The position indicator is advanced by the total amount of bytes read.
|
|
|
Deletes the file whose named is specified.
|
|
||||||||||||
|
Changes the name of the file or directory If the two strings specify different paths and this is supported by the system, the file is moved to the new location.
|
|
||||||||||||||||
|
Sets the position indicator to a new position.
|
|
|
Returns the current value of the position indicator in the specified file.
|
|
||||||||||||||||||||
|
Writes an array of elements each one with a size from the block of memory pointed to the current position in the file.
|
|
|
Opens the debug file specified as a parameter.
|
|
||||||||||||
|
Writes in a debug file a sequence of data formatted as the format parameter specifies.
|
|
|
Creates a directory.
|
|
||||||||||||
|
Writes to the error output a sequence of data formatted as the format parameter specifies.
|
|
||||||||||||
|
Writes to the standard output a sequence of data formatted as the format parameter specifies.
|
|
||||||||||||||||||||
|
Writes in a string a sequence of data formatted with both size and format specified.
|
|
||||||||||||||||
|
Writes in a string a sequence of data formatted as the format parameters specifies.
|
|
|
Gets a KFILE structure for specific streams.
|
|
||||||||||||
|
Gets the buffer represented by a KFILE structure.
|
1.3.8