From 315f3268525dc05c587ab4b28772b73cb18e66ef Mon Sep 17 00:00:00 2001 From: gennyble Date: Wed, 2 Apr 2025 06:15:57 -0500 Subject: improve ffi --- stats_module/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'stats_module') diff --git a/stats_module/src/lib.rs b/stats_module/src/lib.rs index 2c1bce0..47a5e6f 100644 --- a/stats_module/src/lib.rs +++ b/stats_module/src/lib.rs @@ -1,9 +1,9 @@ use rusqlite::{Connection, params}; -use smalldog::{ModuleRequest, ModuleResponse, Request, Response}; +use smalldog::{Request, Response, ffi}; use time::{Duration, OffsetDateTime}; #[unsafe(no_mangle)] -extern "C" fn cgi_handle(req: *const ModuleRequest) -> *const ModuleResponse { +extern "C" fn cgi_handle(req: *const ffi::ModuleRequest) -> *const ffi::ModuleResponse { let mut response = Response::new(); let mut body = String::new(); @@ -67,7 +67,7 @@ extern "C" fn cgi_handle(req: *const ModuleRequest) -> *const ModuleResponse { response.into_mod_response(200) } -fn make_error>(code: u16, msg: S) -> *const ModuleResponse { +fn make_error>(code: u16, msg: S) -> *const ffi::ModuleResponse { let mut response = Response::new(); response.header(c"Content-Length", c"text/html"); response.body(msg.as_ref().as_bytes().to_vec()); @@ -76,6 +76,6 @@ fn make_error>(code: u16, msg: S) -> *const ModuleResponse { } #[unsafe(no_mangle)] -extern "C" fn cgi_cleanup(response: *const ModuleResponse) { +extern "C" fn cgi_cleanup(response: *const ffi::ModuleResponse) { Response::cleanup(response); } -- cgit 1.4.1-3-g733a5