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_ |
#ifndef ASSETS_H_ |
||||
#define ASSETS_H_ |
#define ASSETS_H_ |
||||
|
|
||||
|
#include <stdint.h> |
||||
|
|
||||
typedef struct { |
typedef struct { |
||||
char *file; // string
|
char *file; // string
|
||||
char **sources; // string list
|
char **sources; // string list
|
||||
} asset; |
} asset; |
||||
|
|
||||
asset* asset_init(const char *name); |
void assets_extract(); |
||||
|
void assets_load(asset **info); |
||||
|
|
||||
asset** assets_init(); |
asset** assets_init(); |
||||
|
asset* asset_init(const char *name); |
||||
void assets_dump(asset **asset_list); |
void assets_dump(asset **asset_list); |
||||
void assets_free(asset **asset_list); |
void assets_free(asset **asset_list); |
||||
uint32_t assets_size(asset **asset_list); |
uint32_t assets_size(asset **asset_list); |
||||
void assets_append(asset ***asset_list, asset *res); |
void assets_append(asset ***asset_list, asset *res); |
||||
|
|
||||
void assets_load(asset **info); |
/// Rust assets interface
|
||||
|
void assets_log_init(uint8_t verbose); |
||||
void assets_extract(); |
uint8_t asset_update(const char *file, char *const *sources, const char *assets_dir); |
||||
|
|
||||
//void assets_log_init(uint8_t verbose);
|
|
||||
//
|
|
||||
//uint8_t rust_assets_update(const char *file, char *const *sources, const char *assets_dir);
|
|
||||
|
|
||||
#endif |
#endif |
||||
|
@ -1,31 +1,2 @@ |
|||||
mod ffi; |
mod ffi; |
||||
|
mod fetch; |
||||
// 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");
|
|
||||
//
|
|
||||
// }
|
|
||||
|
Loading…
Reference in new issue