Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sessions #976

Open
wants to merge 62 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 61 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
ebe3c8c
Add global _SESSION variable
mt-omarov Feb 20, 2024
6b2f3a6
Define sessions
mt-omarov Mar 20, 2024
362fbd1
Add sessions to compilation target
mt-omarov Mar 27, 2024
14fa559
Stage non-working version of sessions
mt-omarov Mar 27, 2024
0774419
Add new global array for session handler
mt-omarov Apr 1, 2024
efa217d
Change the session_start() arguments
mt-omarov Apr 1, 2024
c0bf684
Implement basic functions of sessions: session_start, session_read
mt-omarov Apr 1, 2024
e6a6894
Refactor the code: add aliases for array keys. Implement other basic …
mt-omarov Apr 2, 2024
5e04548
Add session_id function for output id
mt-omarov Jul 8, 2024
33764f1
Add first php test
mt-omarov Jul 8, 2024
718951b
init
andarut Jul 9, 2024
5db00ea
temporaly disable buster build die to sury issue
andarut Jul 9, 2024
a2d8afb
Add session_id(), hide session_destroy()
mt-omarov Jul 10, 2024
c42a920
update
andarut Jul 10, 2024
08c5a04
Fix tags, change flock, add macros
mt-omarov Jul 10, 2024
b2ecb61
Add cpp-tests (within single process (worker))
mt-omarov Jul 10, 2024
bab9c4e
Add unlock fcntl to the session_close() and rewind logic in session_w…
mt-omarov Jul 12, 2024
99b437f
focal+gcc-10 and buster+clang
andarut Jul 11, 2024
3ece261
Merge branch 'master' into andreylzmw/runtime_light_ci
andarut Jul 15, 2024
318cfda
resolve
andarut Jul 16, 2024
7aaf62d
init
andarut Jul 9, 2024
66c040f
temporaly disable buster build die to sury issue
andarut Jul 9, 2024
ddc5272
update
andarut Jul 10, 2024
78bee1f
focal+gcc-10 and buster+clang
andarut Jul 11, 2024
a931aa6
resolve
andarut Jul 16, 2024
ef02515
resolve
andarut Jul 16, 2024
5f9c6b6
continue
andarut Jul 16, 2024
1f6928c
continue
andarut Jul 16, 2024
6500be4
g++-10 option when compiling script
andarut Jul 16, 2024
ea216c2
update
andarut Jul 16, 2024
2bcaf27
test
andarut Jul 16, 2024
807e588
test2
andarut Jul 16, 2024
d5482a6
test
andarut Jul 16, 2024
cb09c76
test
andarut Jul 16, 2024
790db6e
fcoroutins flag only with gcc, not with clang
andarut Jul 17, 2024
b611b47
move to gcc-11 on focal
andarut Jul 17, 2024
f5a4edd
fix conditions
andarut Jul 17, 2024
8d194f1
fix conditions
andarut Jul 17, 2024
6c49565
try fix cache
andarut Jul 17, 2024
bf88ac2
light runtime fpic
andarut Jul 17, 2024
e8fd52f
cleanup
andarut Jul 17, 2024
1ec1a02
Merge branch 'andreylzmw/runtime_light_ci' of github.com:VKCOM/kphp i…
astrophysik Jul 17, 2024
32d1a24
format code
astrophysik Jul 17, 2024
92ccc80
remove less `-` in dry-run
astrophysik Jul 17, 2024
4675969
fix macos gh build
andarut Jul 17, 2024
937d928
remove -Wno-unused-result flag
andarut Jul 17, 2024
4dcc3d6
Merge master
mt-omarov Jul 18, 2024
4f6d311
Add resetting the session status in session_close(), add check on NUL…
mt-omarov Jul 18, 2024
ad4307c
Merge branch 'runtime_light_ci' into sessions
mt-omarov Jul 18, 2024
c08969a
Fix session_gc(), change mode of session files
mt-omarov Jul 20, 2024
6dc5241
Replace fcntl() logic with lockf() for blocking workers
mt-omarov Jul 23, 2024
8d4ad55
Add SameSite cookie option, implement new setcookie function with arr…
mt-omarov Jul 23, 2024
c17cda3
Add session.use_strict_mode option
mt-omarov Jul 24, 2024
1407551
Add session_destroy() function
mt-omarov Jul 24, 2024
37ff87d
Add session.sid_length option, add a check to mkdir() in session_open()
mt-omarov Jul 24, 2024
007e55b
Add session.lazy_write option
mt-omarov Jul 24, 2024
d813b1a
Add session_reset(), session_save_path(), session_unset()
mt-omarov Jul 24, 2024
be0f21a
Delete undue php file
mt-omarov Jul 24, 2024
27aef61
Hide session_destroy()
mt-omarov Jul 24, 2024
e8333e9
Update cpp tests
mt-omarov Jul 24, 2024
4efbde7
Add to-do list
mt-omarov Jul 24, 2024
fa4fe66
Merge master
mt-omarov Sep 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 41 additions & 13 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,39 @@ jobs:
cpp: 17
asan: off
ubsan: off
light_runtime: off
- os: focal
compiler: clang++
cpp: 17
asan: off
ubsan: on
light_runtime: off
- os: focal
compiler: g++-10
cpp: 20
asan: on
ubsan: off
light_runtime: off
- os: jammy
compiler: g++
cpp: 20
asan: on
ubsan: off

name: "${{matrix.os}}/${{matrix.compiler}}/c++${{matrix.cpp}}/asan=${{matrix.asan}}/ubsan=${{matrix.ubsan}}"
light_runtime: off
- os: focal
compiler: g++-11
cpp: 20
asan: off
ubsan: off
light_runtime: on
- os: focal
compiler: clang++-18
cpp: 20
asan: off
ubsan: off
light_runtime: on

name: "${{matrix.os}}/${{matrix.compiler}}/c++${{matrix.cpp}}/asan=${{matrix.asan}}/ubsan=${{matrix.ubsan}}/light_runtime=${{matrix.light_runtime}}"

steps:
- uses: actions/checkout@v3
Expand All @@ -54,63 +70,75 @@ jobs:
uses: actions/cache@v3
id: docker-image-cache
with:
path: kphp-build-env-${{matrix.os}}.tar
key: docker-image-cache-${{matrix.os}}-${{ hashFiles('.github/workflows/Dockerfile.*', 'tests/python/requirements.txt') }}
path: /tmp/docker-save-${{matrix.os}}
key: docker-save-${{matrix.os}}-${{ hashFiles('.github/workflows/Dockerfile.*', 'tests/python/requirements.txt') }}

- name: Build and save docker image
if: steps.docker-image-cache.outputs.cache-hit != 'true'
run: |
docker build -f $GITHUB_WORKSPACE/.github/workflows/Dockerfile.${{matrix.os}} $GITHUB_WORKSPACE -t kphp-build-img-${{matrix.os}}
docker save --output kphp-build-env-${{matrix.os}}.tar kphp-build-img-${{matrix.os}}
docker build -f $GITHUB_WORKSPACE/.github/workflows/Dockerfile.${{matrix.os}} $GITHUB_WORKSPACE -t kphp-build-img-${{matrix.os}} --cache-from=type=local,src=kphp-build-img-${{matrix.os}}-cache
docker tag kphp-build-img-${{matrix.os}} kphp-build-img-${{matrix.os}}-cache && mkdir -p /tmp/docker-save-${{matrix.os}} && docker save kphp-build-img-${{matrix.os}}-cache -o /tmp/docker-save-${{matrix.os}}/kphp-build-env-${{matrix.os}}.tar && ls -lh /tmp/docker-save-${{matrix.os}}

- name: Load docker image from cache
if: steps.docker-image-cache.outputs.cache-hit == 'true'
run: docker load --input kphp-build-env-${{matrix.os}}.tar
run: docker load --input /tmp/docker-save-${{matrix.os}}/kphp-build-env-${{matrix.os}}.tar

- name: Start docker container
run: |
docker run -dt --name kphp-build-container-${{matrix.os}} kphp-build-img-${{matrix.os}}
docker run -dt --name kphp-build-container-${{matrix.os}} kphp-build-img-${{matrix.os}}-cache
docker cp $GITHUB_WORKSPACE/. kphp-build-container-${{matrix.os}}:${{env.kphp_root_dir}}

- name: Add git safe directory
run: docker exec kphp-build-container-${{matrix.os}} bash -c
"git config --global --add safe.directory ${{env.kphp_root_dir}}"

- name: Check formatting in light runtime folder
if: ${{ matrix.os == 'focal' && matrix.light_runtime == 'on' }}
run: docker exec kphp-build-container-${{matrix.os}} bash -c
"find ${{env.kphp_root_dir}}/runtime-light/ -iname '*.h' -o -iname '*.cpp' | xargs clang-format-18 --dry-run -Werror"

- name: Build all
run: docker exec kphp-build-container-${{matrix.os}} bash -c
"cmake -DCMAKE_CXX_COMPILER=${{matrix.compiler}} -DCMAKE_CXX_STANDARD=${{matrix.cpp}} -DADDRESS_SANITIZER=${{matrix.asan}} -DUNDEFINED_SANITIZER=${{matrix.ubsan}} -DPDO_DRIVER_MYSQL=ON -DPDO_DRIVER_PGSQL=ON -DPDO_LIBS_STATIC_LINKING=ON -S ${{env.kphp_root_dir}} -B ${{env.kphp_build_dir}} && make -C ${{env.kphp_build_dir}} -j$(nproc) all"
"cmake -DCMAKE_CXX_COMPILER=${{matrix.compiler}} -DCMAKE_CXX_STANDARD=${{matrix.cpp}} -DCOMPILE_RUNTIME_LIGHT=${{matrix.light_runtime}} -DADDRESS_SANITIZER=${{matrix.asan}} -DUNDEFINED_SANITIZER=${{matrix.ubsan}} -DPDO_DRIVER_MYSQL=ON -DPDO_DRIVER_PGSQL=ON -DPDO_LIBS_STATIC_LINKING=ON -S ${{env.kphp_root_dir}} -B ${{env.kphp_build_dir}} && make -C ${{env.kphp_build_dir}} -j$(nproc) all"

- name: Run unit tests
run: docker exec kphp-build-container-${{matrix.os}} bash -c
"make -C ${{env.kphp_build_dir}} -j$(nproc) test"

- name: Compile dummy PHP script
if: matrix.light_runtime == 'off'
run: docker exec kphp-build-container-${{matrix.os}} bash -c
"cd ${{env.kphp_build_dir}} && echo 'hello world' > demo.php && ${{env.kphp_root_dir}}/objs/bin/kphp2cpp --cxx ${{matrix.compiler}} demo.php && kphp_out/server -o --user kitten"

- name: Compile dummy PHP script
if: matrix.light_runtime == 'on'
run: docker exec kphp-build-container-${{matrix.os}} bash -c
"cd ${{env.kphp_build_dir}} && echo "${{matrix.light_runtime}}" && echo 'hello world' > demo.php && ${{env.kphp_root_dir}}/objs/bin/kphp2cpp --mode k2-component --cxx ${{matrix.compiler}} demo.php"

- name: Polyfills composer install
run: docker exec kphp-build-container-${{matrix.os}} bash -c
"composer install -d ${{env.kphp_polyfills_dir}}"

- name: Run python tests
if: matrix.light_runtime == 'off'
id: python_tests
continue-on-error: true
run: docker exec kphp-build-container-${{matrix.os}} bash -c
"chown -R kitten /home && su kitten -c 'GITHUB_ACTIONS=1 KPHP_TESTS_POLYFILLS_REPO=${{env.kphp_polyfills_dir}} KPHP_CXX=${{matrix.compiler}} python3.7 -m pytest --tb=native -n$(nproc) ${{env.kphp_root_dir}}/tests/python/'"

- name: Prepare python tests artifacts
if: steps.python_tests.outcome == 'failure'
if: ${{ (steps.python_tests.outcome == 'failure') && matrix.light_runtime == 'off' }}
run: docker cp kphp-build-container-${{matrix.os}}:${{env.kphp_root_dir}}/tests/python/_tmp/ ${{runner.temp}} &&
rm -rf ${{runner.temp}}/_tmp/*/working_dir

- name: Upload python tests artifacts
uses: actions/upload-artifact@v3
if: steps.python_tests.outcome == 'failure'
if: ${{ (steps.python_tests.outcome == 'failure') && matrix.light_runtime == 'off' }}
with:
path: ${{runner.temp}}/_tmp/

- name: Fail pipeline if python tests failed
if: steps.python_tests.outcome == 'failure'
if: ${{ (steps.python_tests.outcome == 'failure') && matrix.light_runtime == 'off' }}
run: exit 1

- name: Remove docker container
Expand Down Expand Up @@ -142,7 +170,7 @@ jobs:
brew update
brew install re2c cmake coreutils openssl libiconv re2 pcre yaml-cpp zstd googletest shivammathur/php/[email protected]
brew link --overwrite --force shivammathur/php/[email protected]
/usr/local/Frameworks/Python.framework/Versions/3.12/bin/python3.12 -m pip install --upgrade pip --break-system-packages && /usr/local/Frameworks/Python.framework/Versions/3.12/bin/pip3 install jsonschema install --break-system-packages jsonschema
/usr/local/Frameworks/Python.framework/Versions/3.12/bin/python3.12 -m pip install --upgrade pip --break-system-packages && /usr/local/Frameworks/Python.framework/Versions/3.12/bin/pip3 install --break-system-packages jsonschema

- name: Run cmake
run: cmake -DCMAKE_CXX_COMPILER=${{matrix.compiler}} -DCMAKE_CXX_STANDARD=${{matrix.cpp}} -DDOWNLOAD_MISSING_LIBRARIES=On -S $GITHUB_WORKSPACE -B ${{runner.workspace}}/build
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/Dockerfile.focal
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ COPY tests/python/requirements.txt /tmp/
RUN apt-get update && \
apt-get install -y --no-install-recommends apt-utils ca-certificates gnupg wget pkg-config software-properties-common && \
wget -qO /etc/apt/trusted.gpg.d/vkpartner.asc https://artifactory-external.vkpartner.ru/artifactory/api/gpg/key/public && \
wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
add-apt-repository ppa:ubuntu-toolchain-r/test && \
echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-18 main" >> /etc/apt/sources.list && \
echo "deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-18 main" >> /etc/apt/sources.list && \
echo "deb https://artifactory-external.vkpartner.ru/artifactory/kphp focal main" >> /etc/apt/sources.list && \
echo "deb http://apt.postgresql.org/pub/repos/apt focal-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install -y --no-install-recommends \
git cmake make clang g++ g++-10 gperf netcat \
git cmake make clang g++ g++-10 g++-11 clang-18 libclang-rt-18-dev clang-format-18 gperf netcat \
python3.7 python3-pip python3.7-distutils python3.7-dev libpython3.7-dev python3-jsonschema python3-setuptools mysql-server libmysqlclient-dev && \
python3.7 -m pip install pip && python3.7 -m pip install -r /tmp/requirements.txt && \
apt-get install -y --no-install-recommends curl-kphp-vk kphp-timelib libuber-h3-dev libfmt-dev libgtest-dev libgmock-dev libre2-dev libpcre3-dev \
Expand Down
17 changes: 17 additions & 0 deletions builtin-functions/kphp-full/_functions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ global $_COOKIE;
global $_REQUEST;
/** @var mixed $_ENV */
global $_ENV;
/** @var mixed $_SESSION */
global $_SESSION;
/** @var mixed $argc */
global $argc;
/** @var mixed $argv */
Expand Down Expand Up @@ -773,6 +775,21 @@ function mb_strtolower ($str ::: string, $encoding ::: string = "cp1251") ::: st
function mb_strtoupper ($str ::: string, $encoding ::: string = "cp1251") ::: string;
function mb_substr ($str ::: string, $start ::: int, $length ::: mixed = PHP_INT_MAX, $encoding ::: string = "cp1251") ::: string;

function session_start($options ::: mixed = array()) ::: bool;
function session_abort() ::: bool;
function session_commit() ::: bool;
function session_write_close() ::: bool;
function session_gc() ::: bool;
function session_status() ::: int;
function session_id($id ::: ?string = null) ::: string | false;
function session_encode() ::: string | false;
function session_decode($data ::: string) ::: bool;
function session_get_cookie_params() ::: array;
function session_reset() ::: bool;
function session_save_path($path ::: ?string = null) ::: string | false;
function session_unset() ::: bool;
// function session_destroy() ::: bool;

define('PHP_ROUND_HALF_UP', 123423141);
define('PHP_ROUND_HALF_DOWN', 123423144);
define('PHP_ROUND_HALF_EVEN', 123423145);
Expand Down
6 changes: 4 additions & 2 deletions cmake/init-compilation-flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES Clang)
set(COMPILER_CLANG True)
elseif(CMAKE_CXX_COMPILER_ID MATCHES GNU)
if (COMPILE_RUNTIME_LIGHT)
check_compiler_version(gcc 10.1.0)
check_compiler_version(gcc 11.4.0)
else()
check_compiler_version(gcc 8.3.0)
endif()
Expand Down Expand Up @@ -106,7 +106,8 @@ endif()
add_compile_options(-Werror -Wall -Wextra -Wunused-function -Wfloat-conversion -Wno-sign-compare
-Wuninitialized -Wno-redundant-move -Wno-missing-field-initializers)
if(COMPILE_RUNTIME_LIGHT)
add_compile_options(-Wno-vla-cxx-extension)
add_compile_options(-Wno-type-limits -Wno-attributes -Wno-ignored-attributes)
add_compile_options(-Wno-vla-extension)
endif()

if(NOT APPLE)
Expand Down Expand Up @@ -134,6 +135,7 @@ if(COMPILE_RUNTIME_LIGHT)
"${PROJECT_BINARY_DIR}/tmp"
"${PROJECT_BINARY_DIR}/check_coroutine_include.cpp"
COMPILE_DEFINITIONS "${TRY_COMPILE_COMPILE_OPTIONS}"
CXX_STANDARD 20
)
if(NOT HAS_COROUTINE)
message(FATAL_ERROR "Compiler or libstdc++ does not support coroutines")
Expand Down
9 changes: 5 additions & 4 deletions common/dl-utils-lite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <array>
#include <cassert>
#include <cinttypes>
#include <tuple>
#include <errno.h>
#include <execinfo.h>
#include <fcntl.h>
Expand Down Expand Up @@ -49,9 +50,9 @@ double dl_time() {
}

void dl_print_backtrace(void **trace, int trace_size) {
write (2, "\n------- Stack Backtrace -------\n", 33);
std::ignore = write (2, "\n------- Stack Backtrace -------\n", 33);
backtrace_symbols_fd (trace, trace_size, 2);
write (2, "-------------------------------\n", 32);
std::ignore = write (2, "-------------------------------\n", 32);
}

void dl_print_backtrace() {
Expand All @@ -71,7 +72,7 @@ void dl_print_backtrace_gdb() {
name_buf[res] = 0;
int child_pid = fork();
if (child_pid < 0) {
write (2, "Can't fork() to run gdb\n", 24);
std::ignore = write (2, "Can't fork() to run gdb\n", 24);
_exit (0);
}
if (!child_pid) {
Expand All @@ -83,7 +84,7 @@ void dl_print_backtrace_gdb() {
waitpid (child_pid, nullptr, 0);
}
} else {
write (2, "can't get name of executable file to pass to gdb\n", 49);
std::ignore = write (2, "can't get name of executable file to pass to gdb\n", 49);
}
}

Expand Down
1 change: 1 addition & 0 deletions compiler/compiler-settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ void CompilerSettings::init() {
ss << " -std=c++17";
#elif __cplusplus <= 202002L
ss << " -std=c++20";
ss << " -Wno-type-limits -Wno-attributes -Wno-ignored-attributes";
#else
#error unsupported __cplusplus value
#endif
Expand Down
5 changes: 3 additions & 2 deletions compiler/data/var-data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ const ClassMemberInstanceField *VarData::as_class_instance_field() const {
bool VarData::does_name_eq_any_language_superglobal(const std::string &name) {
// these vars are 'superglobals' in PHP language: they are available in all scopes
static const std::unordered_set<std::string> superglobal_names = {
"_SERVER", "_GET", "_POST", "_ENV", "_FILES", "_COOKIE", "_REQUEST",
"_SERVER", "_GET", "_POST", "_ENV", "_FILES", "_COOKIE", "_REQUEST",
"_SESSION", "_KPHPSESSARR"
};
return superglobal_names.find(name) != superglobal_names.end();
}
Expand All @@ -44,7 +45,7 @@ bool VarData::does_name_eq_any_builtin_runtime(const std::string &name) {
// these vars are runtime built-ins, see PhpScriptBuiltInSuperGlobals
static const std::unordered_set<std::string> runtime_names = {
"_SERVER", "_GET", "_POST", "_ENV", "_FILES", "_COOKIE", "_REQUEST",
"argc", "argv", "d$PHP_SAPI"
"_SESSION", "_KPHPSESSARR", "argc", "argv", "d$PHP_SAPI"
};
return runtime_names.find(name) != runtime_names.end();
}
Expand Down
1 change: 1 addition & 0 deletions runtime-core/runtime-core.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ set(KPHP_CORE_SRC
)

vk_add_library(runtime-core OBJECT ${KPHP_CORE_SRC})
set_property(TARGET runtime-core PROPERTY POSITION_INDEPENDENT_CODE ON)
2 changes: 2 additions & 0 deletions runtime-light/core/globals/php-script-globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ struct PhpScriptBuiltInSuperGlobals {
mixed v$_FILES;
mixed v$_COOKIE;
mixed v$_REQUEST;
mixed v$_SESSION;
mixed v$_KPHPSESSARR;

// variables below are not superglobals of the PHP language, but since they are set by runtime,
// the compiler is also aware about them
Expand Down
17 changes: 5 additions & 12 deletions runtime-light/header.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ struct PlatformCtx {
* `stream_d` will be assigned `0`.
* however `stream_d=0` itself is not an error marker
*/
enum OpenStreamResult (*open)(size_t name_len, const char *name,
uint64_t *stream_d);
enum OpenStreamResult (*open)(size_t name_len, const char *name, uint64_t *stream_d);
/*
* If the write or read status is `Blocked` - then the platform ensures that
* the component receives this `stream_d` via `take_update` when the status is
Expand All @@ -118,8 +117,7 @@ struct PlatformCtx {
* `new_status` will be assigned as
* `{.read_status = 0, .write_status = 0, .please_shutdown = 0}`.
*/
enum GetStatusResult (*get_stream_status)(uint64_t stream_d,
struct StreamStatus *new_status);
enum GetStatusResult (*get_stream_status)(uint64_t stream_d, struct StreamStatus *new_status);
/*
* Return processed bytes (written or read).
* Guaranteed to return `0` if the stream is `Closed`, `Blocked` or
Expand Down Expand Up @@ -190,8 +188,7 @@ struct PlatformCtx {
*
* `deadline` will be assigned `0` if `timer_d` invalid
*/
enum TimerStatus (*get_timer_status)(uint64_t timer_d,
struct TimePoint *deadline);
enum TimerStatus (*get_timer_status)(uint64_t timer_d, struct TimePoint *deadline);
/*
* Return: `bool`.
* If `True`: the update was successfully received.
Expand Down Expand Up @@ -262,15 +259,11 @@ struct ImageInfo {
};

// Every image should provide these symbols
enum PollStatus vk_k2_poll(const struct ImageState *image_state,
const struct PlatformCtx *pt_ctx,
struct ComponentState *component_ctx);
enum PollStatus vk_k2_poll(const struct ImageState *image_state, const struct PlatformCtx *pt_ctx, struct ComponentState *component_ctx);

// platform_ctx without IO stuff (nullptr instead io-functions)
// for now, returning nullptr will indicate error
struct ComponentState *
vk_k2_create_component_state(const struct ImageState *image_state,
const struct PlatformCtx *pt_ctx);
struct ComponentState *vk_k2_create_component_state(const struct ImageState *image_state, const struct PlatformCtx *pt_ctx);

// platform_ctx without IO stuff (nullptr instead io-functions)
// for now, returning nullptr will indicate error
Expand Down
Loading