mirror of https://github.com/dnomd343/ClearDNS
Dnomd343
2 years ago
7 changed files with 105 additions and 87 deletions
@ -1,25 +1,25 @@ |
|||
#ifndef ASSETS_H_ |
|||
#define ASSETS_H_ |
|||
|
|||
#include <stdint.h> |
|||
|
|||
typedef struct { |
|||
char *file; // string
|
|||
char **sources; // string list
|
|||
} asset; |
|||
|
|||
asset* asset_init(const char *name); |
|||
void assets_extract(); |
|||
void assets_load(asset **info); |
|||
|
|||
asset** assets_init(); |
|||
asset* asset_init(const char *name); |
|||
void assets_dump(asset **asset_list); |
|||
void assets_free(asset **asset_list); |
|||
uint32_t assets_size(asset **asset_list); |
|||
void assets_append(asset ***asset_list, asset *res); |
|||
|
|||
void assets_load(asset **info); |
|||
|
|||
void assets_extract(); |
|||
|
|||
//void assets_log_init(uint8_t verbose);
|
|||
//
|
|||
//uint8_t rust_assets_update(const char *file, char *const *sources, const char *assets_dir);
|
|||
/// Rust assets interface
|
|||
void assets_log_init(uint8_t verbose); |
|||
uint8_t asset_update(const char *file, char *const *sources, const char *assets_dir); |
|||
|
|||
#endif |
|||
|
@ -1,31 +1,2 @@ |
|||
mod ffi; |
|||
|
|||
// use std::ffi::{c_char, CStr};
|
|||
|
|||
// const TIMEOUT: u64 = 60;
|
|||
//
|
|||
// const ASSETS_DIR: &str = "/cleardns/assets/";
|
|||
|
|||
|
|||
// #[tokio::main]
|
|||
// async fn main() {
|
|||
//
|
|||
// set_var("RUST_LOG", "trace");
|
|||
// env_logger::init();
|
|||
//
|
|||
// let d = vec![
|
|||
// String::from("https://res.343.re/Share/cleardns/gfwlist.txt"),
|
|||
// String::from("/tmp/gfwlist.txt"),
|
|||
// ];
|
|||
// let info = Asset {
|
|||
// name: String::from("demo"),
|
|||
// timeout: TIMEOUT,
|
|||
// workdir: String::from(ASSETS_DIR),
|
|||
// sources: d,
|
|||
// };
|
|||
// fetch::asset_fetch(&info).await;
|
|||
//
|
|||
//
|
|||
// println!("end demo");
|
|||
//
|
|||
// }
|
|||
mod fetch; |
|||
|
Loading…
Reference in new issue