-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
437 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// SPDX-License-Identifier: LGPL-3.0-or-later | ||
#pragma once | ||
|
||
// for sizeof(io_t) | ||
#include "io/impl.h" // IWYU pragma: export | ||
|
||
CT_BEGIN_API | ||
|
||
/// @ingroup io_impl | ||
/// @{ | ||
|
||
/// @brief a read/write in memory file | ||
/// @warning this is an internal structure and should not be used directly | ||
typedef struct io_buffer_impl_t | ||
{ | ||
/// @brief stored data | ||
char *data; | ||
|
||
/// @brief used data | ||
size_t used; | ||
|
||
/// @brief total size of data | ||
size_t total; | ||
|
||
/// @brief current offset in data | ||
size_t offset; | ||
} io_buffer_impl_t; | ||
|
||
#define IO_BUFFER_SIZE (sizeof(io_buffer_impl_t) + sizeof(io_t)) | ||
|
||
/// @} | ||
|
||
CT_END_API |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// SPDX-License-Identifier: LGPL-3.0-or-later | ||
#pragma once | ||
|
||
// for sizeof(io_t) | ||
#include "io/impl.h" // IWYU pragma: export | ||
|
||
#include "os/os.h" | ||
|
||
CT_BEGIN_API | ||
|
||
/// @ingroup io_impl | ||
/// @{ | ||
|
||
/// @brief a file descriptor | ||
/// @warning this is an internal structure and should not be used directly | ||
typedef struct io_file_impl_t | ||
{ | ||
/// @brief native file descriptor | ||
os_file_t file; | ||
|
||
/// @brief memory mapping | ||
os_mapping_t mapping; | ||
} io_file_impl_t; | ||
|
||
#define IO_FILE_SIZE (sizeof(io_file_impl_t) + sizeof(io_t)) | ||
|
||
/// @} | ||
|
||
CT_END_API |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// SPDX-License-Identifier: LGPL-3.0-or-later | ||
#pragma once | ||
|
||
// for sizeof(io_t) | ||
#include "io/impl.h" // IWYU pragma: export | ||
|
||
CT_BEGIN_API | ||
|
||
/// @ingroup io_impl | ||
/// @{ | ||
|
||
/// @brief a non-owning, readonly view of a buffer | ||
/// @warning this is an internal structure and should not be used directly | ||
typedef struct io_view_impl_t | ||
{ | ||
/// @brief pointer to data | ||
const char *data; | ||
|
||
/// @brief size of data | ||
size_t size; | ||
|
||
/// @brief current offset in data | ||
size_t offset; | ||
} io_view_impl_t; | ||
|
||
#define IO_VIEW_SIZE (sizeof(io_view_impl_t) + sizeof(io_t)) | ||
|
||
/// @} | ||
|
||
CT_END_API |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.