Skip to content

Commit ca2185d

Browse files
prateekmediaelbertronnie
authored andcommitted
[rust] add options module (#1632)
* create lib_ccxr and libccxr_exports * add log module * add encoding module * add common constants module * add time units module * add options module * chore: update Cargo lock files * fix: remove duplicacy * fix: doc error * fix: errors * fix: remove time folder * chore: lint fix * chore: lint fix * fix: errors * fix: add time mod to utils * fix: unreachable code * fix: logging function * chore: update lock file * chore: remove duplicate comment * feat: blend parser and options * chore: lint fix * chore: lint fix * fix: imports * fix: error in version * chore: lint fixes * chore: more lint fixes * fix: error in svc * chore: remove from options function --------- Co-authored-by: Elbert Ronnie <[email protected]>
1 parent 5f0b1ff commit ca2185d

File tree

24 files changed

+1954
-1683
lines changed

24 files changed

+1954
-1683
lines changed

src/lib_ccx/utility.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
int temp_debug = 0; // This is a convenience variable used to enable/disable debug on variable conditions. Find references to understand.
1010
volatile sig_atomic_t change_filename_requested = 0;
1111

12+
#ifndef DISABLE_RUST
13+
extern void ccxr_timestamp_to_srttime(uint64_t timestamp, char *buffer);
14+
extern void ccxr_timestamp_to_vtttime(uint64_t timestamp, char *buffer);
15+
extern void ccxr_millis_to_date(uint64_t timestamp, char *buffer, enum ccx_output_date_format date_format, char millis_separator);
16+
extern int ccxr_stringztoms(const char *s, struct ccx_boundary_time *bt);
17+
#endif
18+
1219
static uint32_t crc32_table[] = {
1320
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9,
1421
0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
@@ -92,7 +99,8 @@ int stringztoms(const char *s, struct ccx_boundary_time *bt)
9299
#ifndef DISABLE_RUST
93100
return ccxr_stringztoms(s, bt);
94101
#endif
95-
unsigned ss = 0, mm = 0, hh = 0;
102+
unsigned ss = 0,
103+
mm = 0, hh = 0;
96104
int value = -1;
97105
int colons = 0;
98106
const char *c = s;

src/rust/Cargo.lock

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

src/rust/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ time = "0.3.25"
2727
cfg-if = "1.0.0"
2828
num-integer = "0.1.45"
2929
lib_ccxr = { path = "lib_ccxr" }
30+
url = "2.5.2"
3031

3132
[build-dependencies]
3233
bindgen = "0.64.0"

src/rust/build.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ fn main() {
2929
"lib_cc_decode",
3030
"cc_subtitle",
3131
"ccx_output_format",
32+
"ccx_boundary_time",
33+
"gop_time_code",
3234
"ccx_s_options",
3335
"ccx_s_teletext_config",
3436
"ccx_output_format",
@@ -87,4 +89,8 @@ fn main() {
8789
.expect("Couldn't write bindings!");
8890
}
8991

90-
const RUSTIFIED_ENUMS: &[&str] = &["dtvcc_(window|pen)_.*", "ccx_output_format"];
92+
const RUSTIFIED_ENUMS: &[&str] = &[
93+
"dtvcc_(window|pen)_.*",
94+
"ccx_output_format",
95+
"ccx_output_date_format",
96+
];

0 commit comments

Comments
 (0)