Skip to content

Commit 976a0a3

Browse files
authored
feat: add file watcher (#765)
1 parent 3ab67d7 commit 976a0a3

File tree

33 files changed

+639
-60
lines changed

33 files changed

+639
-60
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//
2+
// Copyright © 2025 Agora
3+
// This file is part of TEN Framework, an open source project.
4+
// Licensed under the Apache License, Version 2.0, with certain conditions.
5+
// Refer to the "LICENSE" file in the root directory for more information.
6+
//
7+
#pragma once
8+
9+
#include "ten_utils/ten_config.h"
10+
11+
#include <limits.h> // for INT_MAX, LONG_MAX
12+
#include <stdbool.h> // for bool
13+
#include <stddef.h> // for size_t
14+
#include <stdint.h> // for INT32_MAX
15+
16+
static inline bool safe_cast_size_t_to_int(size_t in, int *out) {
17+
if (in <= (size_t)INT_MAX) {
18+
*out = (int)in;
19+
return true;
20+
}
21+
return false;
22+
}
23+
24+
static inline bool safe_cast_size_t_to_long(size_t in, long *out) {
25+
if (in <= (size_t)LONG_MAX) {
26+
*out = (long)in;
27+
return true;
28+
}
29+
return false;
30+
}
31+
32+
static inline bool safe_cast_size_t_to_int32(size_t in, int32_t *out) {
33+
if (in <= (size_t)INT32_MAX) {
34+
*out = (int32_t)in;
35+
return true;
36+
}
37+
return false;
38+
}

core/src/ten_manager/Cargo.lock

Lines changed: 22 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/src/ten_manager/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ tokio = { version = "1", features = [
5959
"sync",
6060
"time",
6161
"process",
62+
"macros",
6263
] }
6364
tokio-macros = "2.5.0"
6465
url = { version = "2.5" }

0 commit comments

Comments
 (0)