Skip to content

Commit

Permalink
[rust] add options module (#1632)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
2 people authored and IshanGrover2004 committed Aug 23, 2024
1 parent 5f0b1ff commit ca2185d
Show file tree
Hide file tree
Showing 24 changed files with 1,954 additions and 1,683 deletions.
10 changes: 9 additions & 1 deletion src/lib_ccx/utility.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
int temp_debug = 0; // This is a convenience variable used to enable/disable debug on variable conditions. Find references to understand.
volatile sig_atomic_t change_filename_requested = 0;

#ifndef DISABLE_RUST
extern void ccxr_timestamp_to_srttime(uint64_t timestamp, char *buffer);
extern void ccxr_timestamp_to_vtttime(uint64_t timestamp, char *buffer);
extern void ccxr_millis_to_date(uint64_t timestamp, char *buffer, enum ccx_output_date_format date_format, char millis_separator);
extern int ccxr_stringztoms(const char *s, struct ccx_boundary_time *bt);
#endif

static uint32_t crc32_table[] = {
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9,
0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
Expand Down Expand Up @@ -92,7 +99,8 @@ int stringztoms(const char *s, struct ccx_boundary_time *bt)
#ifndef DISABLE_RUST
return ccxr_stringztoms(s, bt);
#endif
unsigned ss = 0, mm = 0, hh = 0;
unsigned ss = 0,
mm = 0, hh = 0;
int value = -1;
int colons = 0;
const char *c = s;
Expand Down
97 changes: 93 additions & 4 deletions src/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ time = "0.3.25"
cfg-if = "1.0.0"
num-integer = "0.1.45"
lib_ccxr = { path = "lib_ccxr" }
url = "2.5.2"

[build-dependencies]
bindgen = "0.64.0"
Expand Down
8 changes: 7 additions & 1 deletion src/rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ fn main() {
"lib_cc_decode",
"cc_subtitle",
"ccx_output_format",
"ccx_boundary_time",
"gop_time_code",
"ccx_s_options",
"ccx_s_teletext_config",
"ccx_output_format",
Expand Down Expand Up @@ -87,4 +89,8 @@ fn main() {
.expect("Couldn't write bindings!");
}

const RUSTIFIED_ENUMS: &[&str] = &["dtvcc_(window|pen)_.*", "ccx_output_format"];
const RUSTIFIED_ENUMS: &[&str] = &[
"dtvcc_(window|pen)_.*",
"ccx_output_format",
"ccx_output_date_format",
];
Loading

0 comments on commit ca2185d

Please sign in to comment.